diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-20 18:08:22 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-20 18:08:22 +0200 |
| commit | 9a790024b6f9c4e484d2b4ed7cc6a39090802be8 (patch) | |
| tree | beb4978cafa8d155f00bbac5782e8d79f2828cee /editor/plugins/text_editor.cpp | |
| parent | a1d2396ab9f486a56a1669546d08759d45012181 (diff) | |
| parent | ff310f0969f87e1c8d89c00e0cb635ab983b6951 (diff) | |
| download | redot-engine-9a790024b6f9c4e484d2b4ed7cc6a39090802be8.tar.gz | |
Merge pull request #76269 from KoBeWi/let's_wrap_this_up
Add shortcut for quick-toggling word wrap
Diffstat (limited to 'editor/plugins/text_editor.cpp')
| -rw-r--r-- | editor/plugins/text_editor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 9c0d76a6d3..174588b92e 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -433,6 +433,10 @@ void TextEditor::_edit_option(int p_op) { case EDIT_CAPITALIZE: { _convert_case(CodeTextEditor::CAPITALIZE); } break; + case EDIT_TOGGLE_WORD_WRAP: { + TextEdit::LineWrappingMode wrap = code_editor->get_text_editor()->get_line_wrapping_mode(); + code_editor->get_text_editor()->set_line_wrapping_mode(wrap == TextEdit::LINE_WRAPPING_BOUNDARY ? TextEdit::LINE_WRAPPING_NONE : TextEdit::LINE_WRAPPING_BOUNDARY); + } break; case SEARCH_FIND: { code_editor->get_find_replace_bar()->popup_search(); } break; @@ -649,6 +653,7 @@ TextEditor::TextEditor() { edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/unfold_all_lines"), EDIT_UNFOLD_ALL_LINES); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/duplicate_selection"), EDIT_DUPLICATE_SELECTION); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_word_wrap"), EDIT_TOGGLE_WORD_WRAP); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_spaces"), EDIT_CONVERT_INDENT_TO_SPACES); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/convert_indent_to_tabs"), EDIT_CONVERT_INDENT_TO_TABS); |
