]> granicus.if.org Git - python/commitdiff
Issue #14105: Stop removing breakpoints from Idle editors.
authorTerry Jan Reedy <tjreedy@udel.edu>
Sat, 9 Aug 2014 03:33:16 +0000 (23:33 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sat, 9 Aug 2014 03:33:16 +0000 (23:33 -0400)
Move BREAK tag configuration to PyShellEditorWindow.

Lib/idlelib/ColorDelegator.py
Lib/idlelib/PyShell.py

index 424755f028449e60bba8e400148b55d1dc732547..729dec03482054fd0b5e019f191bba254cb5ecfa 100644 (file)
@@ -72,7 +72,6 @@ class ColorDelegator(Delegator):
             "DEFINITION": idleConf.GetHighlight(theme, "definition"),
             "SYNC": {'background':None,'foreground':None},
             "TODO": {'background':None,'foreground':None},
-            "BREAK": idleConf.GetHighlight(theme, "break"),
             "ERROR": idleConf.GetHighlight(theme, "error"),
             # The following is used by ReplaceDialog:
             "hit": idleConf.GetHighlight(theme, "hit"),
index c23b62abd9bc784fd3591266971972a667c3ada1..865692743a3a8c73174c89f788f0e10338ebb8c9 100755 (executable)
@@ -138,6 +138,7 @@ class PyShellEditorWindow(EditorWindow):
         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 @@ class PyShellEditorWindow(EditorWindow):
         ("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