mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
bpo-38792: Remove IDLE shell calltip before new prompt. (#17150)
Previously, a calltip might be left after SyntaxError, KeyboardInterrupt, or Shell Restart. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Tal Einat <taleinat+github@gmail.com>
This commit is contained in:
parent
46874c26ee
commit
bfdeaa37b3
5 changed files with 9 additions and 3 deletions
|
@ -3,6 +3,9 @@ Released on 2020-10-05?
|
||||||
======================================
|
======================================
|
||||||
|
|
||||||
|
|
||||||
|
bpo-38792: Close a shell calltip if a :exc:`KeyboardInterrupt`
|
||||||
|
or shell restart occurs. Patch by Zackery Spytz.
|
||||||
|
|
||||||
bpo-30780: Add remaining configdialog tests for buttons and
|
bpo-30780: Add remaining configdialog tests for buttons and
|
||||||
highlights and keys tabs.
|
highlights and keys tabs.
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ class Calltip:
|
||||||
# See __init__ for usage
|
# See __init__ for usage
|
||||||
return calltip_w.CalltipWindow(self.text)
|
return calltip_w.CalltipWindow(self.text)
|
||||||
|
|
||||||
def _remove_calltip_window(self, event=None):
|
def remove_calltip_window(self, event=None):
|
||||||
if self.active_calltip:
|
if self.active_calltip:
|
||||||
self.active_calltip.hidetip()
|
self.active_calltip.hidetip()
|
||||||
self.active_calltip = None
|
self.active_calltip = None
|
||||||
|
@ -55,7 +55,7 @@ class Calltip:
|
||||||
self.open_calltip(False)
|
self.open_calltip(False)
|
||||||
|
|
||||||
def open_calltip(self, evalfuncs):
|
def open_calltip(self, evalfuncs):
|
||||||
self._remove_calltip_window()
|
self.remove_calltip_window()
|
||||||
|
|
||||||
hp = HyperParser(self.editwin, "insert")
|
hp = HyperParser(self.editwin, "insert")
|
||||||
sur_paren = hp.get_surrounding_brackets('(')
|
sur_paren = hp.get_surrounding_brackets('(')
|
||||||
|
|
|
@ -328,7 +328,7 @@ class EditorWindow(object):
|
||||||
text.bind("<<run-module>>", scriptbinding.run_module_event)
|
text.bind("<<run-module>>", scriptbinding.run_module_event)
|
||||||
text.bind("<<run-custom>>", scriptbinding.run_custom_event)
|
text.bind("<<run-custom>>", scriptbinding.run_custom_event)
|
||||||
text.bind("<<do-rstrip>>", self.Rstrip(self).do_rstrip)
|
text.bind("<<do-rstrip>>", self.Rstrip(self).do_rstrip)
|
||||||
ctip = self.Calltip(self)
|
self.ctip = ctip = self.Calltip(self)
|
||||||
text.bind("<<try-open-calltip>>", ctip.try_open_calltip_event)
|
text.bind("<<try-open-calltip>>", ctip.try_open_calltip_event)
|
||||||
#refresh-calltip must come after paren-closed to work right
|
#refresh-calltip must come after paren-closed to work right
|
||||||
text.bind("<<refresh-calltip>>", ctip.refresh_calltip_event)
|
text.bind("<<refresh-calltip>>", ctip.refresh_calltip_event)
|
||||||
|
|
|
@ -1292,6 +1292,7 @@ class PyShell(OutputWindow):
|
||||||
self.text.insert("end-1c", "\n")
|
self.text.insert("end-1c", "\n")
|
||||||
self.text.mark_set("iomark", "end-1c")
|
self.text.mark_set("iomark", "end-1c")
|
||||||
self.set_line_and_column()
|
self.set_line_and_column()
|
||||||
|
self.ctip.remove_calltip_window()
|
||||||
|
|
||||||
def write(self, s, tags=()):
|
def write(self, s, tags=()):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Close an IDLE shell calltip if a :exc:`KeyboardInterrupt`
|
||||||
|
or shell restart occurs. Patch by Zackery Spytz.
|
Loading…
Add table
Add a link
Reference in a new issue