mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Add special new line opening
This commit is contained in:
parent
5a9b18b665
commit
bd7f2590f1
@ -1678,9 +1678,30 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
|
||||
}
|
||||
}
|
||||
|
||||
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: {
|
||||
if (completion_hint!="") {
|
||||
|
Loading…
Reference in New Issue
Block a user