Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[pyqgis-console] fixes the undo action when comment/uncomment out cod…
…e in editor
  • Loading branch information
slarosa committed Apr 17, 2013
1 parent a56c05a commit 08ef4f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/console/console_editor.py
Expand Up @@ -341,6 +341,7 @@ def hideEditor(self):
self.parent.pc.showEditorButton.setChecked(False)

def commentEditorCode(self, commentCheck):
self.beginUndoAction()
if self.hasSelectedText():
startLine, _, endLine, _ = self.getSelection()
for line in range(startLine, endLine + 1):
Expand All @@ -355,7 +356,6 @@ def commentEditorCode(self, commentCheck):
self.insert(selCmd[1:])
else:
self.insert(selCmd)
self.setCursorPosition(endLine, selCmd.length() - 2)
else:
line, pos = self.getCursorPosition()
selCmd = self.text(line)
Expand All @@ -369,7 +369,7 @@ def commentEditorCode(self, commentCheck):
self.insert(selCmd[1:])
else:
self.insert(selCmd)
self.setCursorPosition(line, selCmd.length() - 2)
self.endUndoAction()

def runScriptCode(self):
tabWidget = self.parent.mw.currentWidget()
Expand Down

0 comments on commit 08ef4f8

Please sign in to comment.