Skip to content
Permalink
Browse files

[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 08ef4f84f949b7d3ac0d6d7fa2e94fa3d6df3185
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/console/console_editor.py
@@ -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):
@@ -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)
@@ -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()

0 comments on commit 08ef4f8

Please sign in to comment.
You can’t perform that action at this time.