Permalink
Browse files

Fixed Issue #1094

  • Loading branch information...
1 parent 4381fbd commit b4746882f7d27c94ded59d76ae0068fa64d4b0e9 @diegosarmentero diegosarmentero committed Mar 12, 2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 ninja_ide/gui/editor/editor.py
@@ -860,13 +860,17 @@ def __auto_indent(self, event):
def complete_declaration(self):
settings.COMPLETE_DECLARATIONS = not settings.COMPLETE_DECLARATIONS
+ self.insert_new_line()
+ settings.COMPLETE_DECLARATIONS = not settings.COMPLETE_DECLARATIONS
+
+ def insert_new_line(self):
cursor = self.textCursor()
+ at_block_end = cursor.atBlockEnd()
cursor.movePosition(QTextCursor.EndOfLine)
- if cursor.atEnd():
- cursor.insertBlock()
- self.moveCursor(QTextCursor.Down)
+ cursor.insertBlock()
+ if not at_block_end:
+ self.moveCursor(QTextCursor.Down)
self.__auto_indent(None)
- settings.COMPLETE_DECLARATIONS = not settings.COMPLETE_DECLARATIONS
def __complete_braces(self, event):
"""Complete () [] and {} using a mild inteligence to see if corresponds

0 comments on commit b474688

Please sign in to comment.