Skip to content

Commit cac3eb9

Browse files
committed
Fix: Tooltip value error should not show on mouse hover
1 parent 3e1ba51 commit cac3eb9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

pyPad/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -637,13 +637,12 @@ def showCalltip(self, pos=None):
637637
self.activeCalltip = True
638638
editor.callTipShow(iStart, 'set to False')
639639
elif not '\n' in expression:
640-
if CT_unselected and CT_expression or expression != 'value error':
641-
ret = self.interp.getCallTip(None, expression)
642-
if ret:
643-
element, nHighlight, calltip = ret
644-
self.activeCalltip = 'doc'
645-
editor.callTipShow(iStart, ''.join(calltip))
646-
editor.callTipSetHlt(0, int(nHighlight))
640+
ret = self.interp.getCallTip(None, expression)
641+
if ret and (CT_unselected or ret[-1] != 'value error'):
642+
element, nHighlight, calltip = ret
643+
self.activeCalltip = 'doc'
644+
editor.callTipShow(iStart, ''.join(calltip))
645+
editor.callTipSetHlt(0, int(nHighlight))
647646
else:
648647
iLineStart = editor.positionFromLine(editor.lineFromPosition(iStart))
649648
var = editor.getTextRange(iStart, iEnd)
@@ -667,7 +666,7 @@ def showCalltip(self, pos=None):
667666
elif element == var =='True':
668667
self.activeCalltip = True
669668
editor.callTipShow(iStart, 'set to False')
670-
else:
669+
elif ret[-1] != 'value error':
671670
self.activeCalltip = 'doc'
672671
editor.callTipShow(iStart, ''.join(calltip))
673672
editor.callTipSetHlt(0, int(nHighlight))

0 commit comments

Comments
 (0)