Merge pull request #3919 from chuckeles/open-lines-below-above

Open line below and above
This commit is contained in:
Rémi Verschelde 2016-03-07 20:33:05 +01:00
commit 20308c0475
1 changed files with 21 additions and 0 deletions

View File

@ -1677,9 +1677,30 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
ins+="\t"; ins+="\t";
} }
} }
bool first_line = false;
if (k.mod.command) {
if (k.mod.shift) {
if (cursor.line > 0) {
cursor_set_line(cursor.line - 1);
cursor_set_column(text[cursor.line].length());
}
else {
cursor_set_column(0);
first_line = true;
}
}
else {
cursor_set_column(text[cursor.line].length());
}
}
_insert_text_at_cursor(ins); _insert_text_at_cursor(ins);
_push_current_op(); _push_current_op();
if (first_line) {
cursor_set_line(0);
}
} break; } break;
case KEY_ESCAPE: { case KEY_ESCAPE: {