Anonymous avatar Anonymous committed 1cdfa44

Added support for showing/updating disabled breaks in the source

Comments (0)

Files changed (1)

Debugger/Debugger.py

             self.debugger.invokeInDebugger(
                 'clearBreakpoints', (server_fn, bp['lineno']))
             
-            # Unmark the breakpoint in the editor.
-            editor = self.debugger.editor
-            if editor.modules.has_key(filename):
-                sourceView = editor.modules[filename].model.views['Source']
+            # Unmark the breakpoint in the editor (if open)
+            sourceView = self.debugger.getEditorSourceView(filename)
+            if sourceView:
                 sourceView.deleteBreakMarkers(bp['lineno'])
 
             self.refreshList()
             bp = self.bps[sel]
             filename = bp['filename']
             lineno = bp['lineno']
-            enabled = not bp['enabled']
+            enabled = bp['enabled'] = not bp['enabled']
             bplist.enableBreakpoints(filename, lineno, enabled)
             self.debugger.invokeInDebugger(
                 'enableBreakpoints', (filename, lineno, enabled))
             self.refreshList()
+            
+            sourceView = self.debugger.getEditorSourceView(filename)
+            if sourceView:
+                sourceView.deleteBreakMarkers(bp['lineno'])
+                sourceView.setBreakMarker(bp)
 
     def OnRightDown(self, event):
         self.pos = event.GetPosition()
         self.nbTop = wxNotebook(self.splitter, wxID_TOPPAGECHANGED)
         if use_images:
             self.nbTop.SetImageList(self.viewsImgLst)
-##        EVT_NOTEBOOK_PAGE_CHANGED(self.nbTop, wxID_TOPPAGECHANGED,
-##                                  self.OnUpperPageChange)
 
         self.stackView = StackViewCtrl(self.nbTop, None, self)
 
             self.lastStepView.clearStepPos(self.lastStepLineno)
             self.lastStepView = None
 
+    def getEditorSourceView(self, filename):
+        if self.editor.modules.has_key(filename):
+            return self.editor.modules[filename].model.views['Source']
+        else:
+            return None
+
     def selectSourceLine(self, filename, lineno):
         if self.isSourceTracing():
             self.clearStepPos()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.