diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-16 20:11:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 20:11:39 +0200 |
commit | 341cb8da311698d685b390524d0f20795f1774d7 (patch) | |
tree | 7e565ed6fe2a0691a33b0d18b2cdf1103aab53ec /editor/plugins | |
parent | 48fe9c97948f44125e68f3b8f67eaaf032c763bd (diff) | |
parent | 5c618dd03dd4fe1ada234e91a08bcf12eb8f7aa7 (diff) |
Merge pull request #49238 from Paulb23/code_edit_code_folding
Move code folding into CodeEdit and hide line hiding API
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/text_editor.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 1f6da30547..3ec20ae68e 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1061,7 +1061,7 @@ void ScriptTextEditor::_edit_option(int p_op) { code_editor->clone_lines_down(); } break; case EDIT_TOGGLE_FOLD_LINE: { - tx->toggle_fold_line(tx->cursor_get_line()); + tx->toggle_foldable_line(tx->cursor_get_line()); tx->update(); } break; case EDIT_FOLD_ALL_LINES: { @@ -1549,7 +1549,7 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { } bool has_color = (word_at_pos == "Color"); - bool foldable = tx->can_fold(row) || tx->is_folded(row); + bool foldable = tx->can_fold_line(row) || tx->is_line_folded(row); bool open_docs = false; bool goto_definition = false; diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index dc7f85a790..621f843e6f 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -332,7 +332,7 @@ void TextEditor::_edit_option(int p_op) { code_editor->clone_lines_down(); } break; case EDIT_TOGGLE_FOLD_LINE: { - tx->toggle_fold_line(tx->cursor_get_line()); + tx->toggle_foldable_line(tx->cursor_get_line()); tx->update(); } break; case EDIT_FOLD_ALL_LINES: { @@ -432,8 +432,8 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { tx->_get_mouse_pos(mb->get_global_position() - tx->get_global_position(), row, col); tx->set_right_click_moves_caret(EditorSettings::get_singleton()->get("text_editor/cursor/right_click_moves_caret")); - bool can_fold = tx->can_fold(row); - bool is_folded = tx->is_folded(row); + bool can_fold = tx->can_fold_line(row); + bool is_folded = tx->is_line_folded(row); if (tx->is_right_click_moving_caret()) { if (tx->is_selection_active()) { @@ -463,7 +463,7 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) { if (k.is_valid() && k->is_pressed() && k->get_keycode() == KEY_MENU) { CodeEdit *tx = code_editor->get_text_editor(); int line = tx->cursor_get_line(); - _make_context_menu(tx->is_selection_active(), tx->can_fold(line), tx->is_folded(line), (get_global_transform().inverse() * tx->get_global_transform()).xform(tx->_get_cursor_pixel_pos())); + _make_context_menu(tx->is_selection_active(), tx->can_fold_line(line), tx->is_line_folded(line), (get_global_transform().inverse() * tx->get_global_transform()).xform(tx->_get_cursor_pixel_pos())); context_menu->grab_focus(); } } |