Skip to content

Commit

Permalink
Fixed a bug in the remove_line feature that deletes two lines instead…
Browse files Browse the repository at this point in the history
… of one.
  • Loading branch information
carpincho committed Dec 3, 2011
1 parent 855bba4 commit b3cd771
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ninja_ide/gui/editor/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,13 @@ def remove_line(editorWidget):
cursor.beginEditBlock()
if cursor.hasSelection():
cursor.removeSelectedText()
cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.MoveAnchor)
cursor.movePosition(QTextCursor.StartOfLine, QTextCursor.KeepAnchor)
cursor.removeSelectedText()
cursor.deleteChar()
else:
if cursor.columnNumber() == 0: # a blank line
cursor.deleteChar()
else:
cursor.select(QTextCursor.LineUnderCursor)
cursor.removeSelectedText()
cursor.deleteChar()
cursor.endEditBlock()


Expand Down

0 comments on commit b3cd771

Please sign in to comment.