diff options
author | Christophe Andral <christophe@andral.fr> | 2024-02-02 23:10:55 +0100 |
---|---|---|
committer | Christophe Andral <christophe@andral.fr> | 2024-03-25 11:12:28 +0100 |
commit | c988bec4b3dff7ac32a1940a3f5c3d97a46ca8cd (patch) | |
tree | c756bfd9c9d43eee0bbe59546de45c315e69e782 /core | |
parent | 5d08c2631cadf29d80ca23c7d537e03c3e5edcc5 (diff) | |
download | redot-engine-c988bec4b3dff7ac32a1940a3f5c3d97a46ca8cd.tar.gz |
Add 'Skip to next (text) occurrence' feature to text editor
Adds `ui_text_skip_selection_for_next_occurrence` action and related implementation to text editor.
This action is bound `Ctrl+Alt+D` shorcut.
Used in conjonction with `ui_add_skip_selection_for_next_occurrence`, it gives the user the ability to select many occurrences of a selection
and avoid some of them.
Used without a previous selection, the action jumps to the next occurrence of the current word under the caret.
Diffstat (limited to 'core')
-rw-r--r-- | core/input/input_map.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index 5d6de1ad9a..7fd1806b31 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -383,6 +383,7 @@ static const _BuiltinActionDisplayName _builtin_action_display_names[] = { { "ui_text_select_all", TTRC("Select All") }, { "ui_text_select_word_under_caret", TTRC("Select Word Under Caret") }, { "ui_text_add_selection_for_next_occurrence", TTRC("Add Selection for Next Occurrence") }, + { "ui_text_skip_selection_for_next_occurrence", TTRC("Skip Selection for Next Occurrence") }, { "ui_text_clear_carets_and_selection", TTRC("Clear Carets and Selection") }, { "ui_text_toggle_insert_mode", TTRC("Toggle Insert Mode") }, { "ui_text_submit", TTRC("Submit Text") }, @@ -722,6 +723,10 @@ const HashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins() { default_builtin_cache.insert("ui_text_add_selection_for_next_occurrence", inputs); inputs = List<Ref<InputEvent>>(); + inputs.push_back(InputEventKey::create_reference(Key::D | KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT)); + default_builtin_cache.insert("ui_text_skip_selection_for_next_occurrence", inputs); + + inputs = List<Ref<InputEvent>>(); inputs.push_back(InputEventKey::create_reference(Key::ESCAPE)); default_builtin_cache.insert("ui_text_clear_carets_and_selection", inputs); |