From 889f8bf259eee088d2d81e3978fbdf34585fc9ae Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Sat, 6 Jul 2002 04:22:25 +0000 Subject: [PATCH] Modifying EditorWindow causes breakpoints in that module to be removed from both sides of the split debugger. M Debugger.py M EditorWindow.py --- Lib/idlelib/Debugger.py | 6 +++++- Lib/idlelib/EditorWindow.py | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py index c030588a3f7..201715d90d2 100644 --- a/Lib/idlelib/Debugger.py +++ b/Lib/idlelib/Debugger.py @@ -82,6 +82,7 @@ class Debugger: edit_windows = self.pyshell.flist.inversedict.keys() for window in edit_windows: window.text.tag_remove("BREAK", 1.0, END) + window.break_set = False # Clean up pyshell if user clicked debugger control close widget. # (Causes a harmless extra cycle through close_debugger() if user # toggled debugger from pyshell Debug menu) @@ -323,6 +324,7 @@ class Debugger: text.bell() return text.tag_add("BREAK", "insert linestart", "insert lineend +1char") + edit.break_set = True def clear_breakpoint_here(self, edit): text = edit.text @@ -337,6 +339,7 @@ class Debugger: return text.tag_remove("BREAK", "insert linestart",\ "insert lineend +1char") + # Don't bother to track break_set status def clear_file_breaks(self, edit): text = edit.text @@ -348,7 +351,8 @@ class Debugger: if msg: text.bell() return - text.tag_delete("BREAK") + text.tag_remove("BREAK", "1.0", END) + edit.break_set = False class StackViewer(ScrolledList): diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 453e6ca014d..a7aa185c85d 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -101,6 +101,7 @@ class EditorWindow: self.top.instanceDict=flist.inversedict self.recentFilesPath=os.path.join(idleConf.GetUserCfgDir(), 'recent-files.lst') + self.break_set = False self.vbar = vbar = Scrollbar(top, name='vbar') self.text_frame = text_frame = Frame(top) self.text = text = Text(text_frame, name='text', padx=5, wrap=None, @@ -631,6 +632,9 @@ class EditorWindow: if not self.get_saved(): title = "*%s*" % title icon = "*%s" % icon + if self.break_set: + shell = self.flist.pyshell + shell.interp.debugger.clear_file_breaks(self) self.top.wm_title(title) self.top.wm_iconname(icon) @@ -699,8 +703,8 @@ class EditorWindow: #print self.io.filename if self.io.filename: self.UpdateRecentFilesList(newFile=self.io.filename) - shell = self.flist.pyshell - if shell and shell.interp.debugger: + if self.break_set: + shell = self.flist.pyshell shell.interp.debugger.clear_file_breaks(self) WindowList.unregister_callback(self.postwindowsmenu) if self.close_hook: