diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-03-07 20:33:05 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-03-07 20:33:05 +0100 |
commit | 20308c0475acb4678c9b86c7a4f210c1ec7548dc (patch) | |
tree | c6f9050bfb944f87754fd876f0b41a0b539d21b9 /scene | |
parent | 84c879b9e90ac733735ca0be68ef795649a0218d (diff) | |
parent | bd7f2590f19bc3e6e15c532a79823f9a71a4d8ea (diff) |
Merge pull request #3919 from chuckeles/open-lines-below-above
Open line below and above
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/text_edit.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 5d7436517f..df6bd21a93 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1677,9 +1677,30 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { 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); _push_current_op(); + + if (first_line) { + cursor_set_line(0); + } } break; case KEY_ESCAPE: { |