summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-08-09 03:33:16 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-08-09 03:33:16 (GMT)
commitda26cca1cef111282e4be83af0994305c6218ade (patch)
treec84b44007c97d73a7fa5ecffce670129494cc177 /Lib
parent5a794c16d98a12f75b728ff902c410f10f93770f (diff)
downloadcpython-da26cca1cef111282e4be83af0994305c6218ade.zip
cpython-da26cca1cef111282e4be83af0994305c6218ade.tar.gz
cpython-da26cca1cef111282e4be83af0994305c6218ade.tar.bz2
Issue #14105: Stop removing breakpoints from Idle editors.
Move BREAK tag configuration to PyShellEditorWindow.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/ColorDelegator.py1
-rwxr-xr-xLib/idlelib/PyShell.py10
2 files changed, 10 insertions, 1 deletions
diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py
index 424755f..729dec0 100644
--- a/Lib/idlelib/ColorDelegator.py
+++ b/Lib/idlelib/ColorDelegator.py
@@ -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"),
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index c23b62a..8656927 100755
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -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