summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/PyShell.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-08-09 03:33:11 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-08-09 03:33:11 (GMT)
commit25327d4d3bc1bab8b0263a44f8d8790ce03c7877 (patch)
treec8f909cab73df0c6554145286d3e3147d9f4f5eb /Lib/idlelib/PyShell.py
parent19e455f9cb76db40013545efdc0dab6b87d313a6 (diff)
downloadcpython-25327d4d3bc1bab8b0263a44f8d8790ce03c7877.zip
cpython-25327d4d3bc1bab8b0263a44f8d8790ce03c7877.tar.gz
cpython-25327d4d3bc1bab8b0263a44f8d8790ce03c7877.tar.bz2
Issue #14105: Stop removing breakpoints from Idle editors.
Move BREAK tag configuration to PyShellEditorWindow.
Diffstat (limited to 'Lib/idlelib/PyShell.py')
-rwxr-xr-xLib/idlelib/PyShell.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 0d94944..1e86292 100755
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -143,6 +143,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"),
@@ -152,6 +153,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