File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,7 @@ def hideEditor(self):
341
341
self .parent .pc .showEditorButton .setChecked (False )
342
342
343
343
def commentEditorCode (self , commentCheck ):
344
+ self .beginUndoAction ()
344
345
if self .hasSelectedText ():
345
346
startLine , _ , endLine , _ = self .getSelection ()
346
347
for line in range (startLine , endLine + 1 ):
@@ -355,7 +356,6 @@ def commentEditorCode(self, commentCheck):
355
356
self .insert (selCmd [1 :])
356
357
else :
357
358
self .insert (selCmd )
358
- self .setCursorPosition (endLine , selCmd .length () - 2 )
359
359
else :
360
360
line , pos = self .getCursorPosition ()
361
361
selCmd = self .text (line )
@@ -369,7 +369,7 @@ def commentEditorCode(self, commentCheck):
369
369
self .insert (selCmd [1 :])
370
370
else :
371
371
self .insert (selCmd )
372
- self .setCursorPosition ( line , selCmd . length () - 2 )
372
+ self .endUndoAction ( )
373
373
374
374
def runScriptCode (self ):
375
375
tabWidget = self .parent .mw .currentWidget ()
You can’t perform that action at this time.
0 commit comments