Added Insert Line Above/Below actions to BaseTextEditor

The actions perform exactly like their counterparts in Eclipse: a new,
indented line is inserted above or below the current line and the text
cursor is moved to the start of the new line. The line where the cursor
was before the action was triggered remains unchanged.

The shortcuts are also like in Eclipse: "Ctrl+Shift+Return" inserts a
line above the current, "Shift+Return" inserts a line below the current.

Merge-request: 140
Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
This commit is contained in:
André Fillipe
2010-05-03 17:03:11 +02:00
committed by Thorbjørn Lindeijer
parent b61e656493
commit 32ab9878fe
5 changed files with 44 additions and 0 deletions

View File

@@ -116,6 +116,8 @@ private slots:
void copyLineUp();
void copyLineDown();
void joinLines();
void insertLineAbove();
void insertLineBelow();
void updateCurrentEditor(Core::IEditor *editor);
private:
@@ -153,6 +155,8 @@ private:
QAction *m_copyLineUpAction;
QAction *m_copyLineDownAction;
QAction *m_joinLinesAction;
QAction *m_insertLineAboveAction;
QAction *m_insertLineBelowAction;
uint m_optionalActions;
QPointer<BaseTextEditor> m_currentEditor;