Add Duplicate Lines shortcut to CodeTextEditor

This keyboard shortcut has been made with inspiration from the VS Code keyboard shortcut editor.action.copyLinesDownAction. It duplicates all selected lines and inserts them below no matter where the caret is within the line.
This commit is contained in:
PucklaMotzer09 authored and PucklaJ committed 2023-09-25 23:41:31 +02:00
1 parent 43b9e89a07
commit d2e651f403
11 files changed
+174

No files matched your search

+5
View File
@@ -805,6 +805,11 @@ void CodeTextEditor::input(const Ref<InputEvent> &event) {
accept_event();
return;
}
if (ED_IS_SHORTCUT("script_text_editor/duplicate_lines", key_event)) {
text_editor->duplicate_lines();
accept_event();
return;
}
}
void CodeTextEditor::_text_editor_gui_input(const Ref<InputEvent> &p_event) {