Issue #14105: Stop removing breakpoints from Idle editors.

Move BREAK tag configuration to PyShellEditorWindow.
This commit is contained in:
Terry Jan Reedy 2014-08-08 23:33:16 -04:00
parent 5a794c16d9
commit da26cca1ce
2 changed files with 10 additions and 1 deletions

View file

@ -138,6 +138,7 @@ def filename_changed_hook(old_hook=self.io.filename_change_hook,
self.io.set_filename_change_hook(filename_changed_hook)
if self.io.filename:
self.restore_file_breaks()
self.color_breakpoint_text()
rmenu_specs = [
("Cut", "<<cut>>", "rmenu_check_cut"),
@ -148,6 +149,15 @@ def filename_changed_hook(old_hook=self.io.filename_change_hook,
("Clear Breakpoint", "<<clear-breakpoint-here>>", None)
]
def color_breakpoint_text(self, color=True):
"Turn colorizing of breakpoint text on or off"
if color:
theme = idleConf.GetOption('main','Theme','name')
cfg = idleConf.GetHighlight(theme, "break")
else:
cfg = {'foreground': '', 'background': ''}
self.text.tag_config('BREAK', cfg)
def set_breakpoint(self, lineno):
text = self.text
filename = self.io.filename