diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index c7dbd86c55d..30fd47cdb69 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -143,6 +143,20 @@ Inserts the selected entry into the text. If [code]replace[/code] is true, any existing text is replaced rather then merged. + + + + + Perform an indent as if the user activated the "ui_text_indent" action. + + + + + + + Perform an unindent as if the user activated the "ui_text_unindent" action. + + @@ -278,6 +292,13 @@ Returns [code]true[/code] if string [code]start_key[/code] exists. + + + + + Indents selected lines, or in the case of no selection the caret line by one. + + @@ -441,6 +462,13 @@ Unfolds all lines that were previously folded. + + + + + Unindents selected lines, or in the case of no selection the caret line by one. + + @@ -475,6 +503,18 @@ + + Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace is found. + + + Prefixes to trigger an automatic indent. + + + Size of tabs, if [code]indent_use_spaces[/code] is enabled the amount of spaces to use. + + + Use spaces instead of tabs for indentation. + Sets whether line folding is allowed. diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 03e4556c922..6a3c124c60c 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -10,6 +10,12 @@ + + + + + + @@ -18,6 +24,12 @@ + + + + + + @@ -96,6 +108,12 @@ Cut's the current selection. + + + + + + @@ -110,6 +128,14 @@ Gets the caret pixel draw poistion. + + + + + + + + @@ -140,6 +166,14 @@ + + + + + + + + @@ -274,6 +308,12 @@ Returns the selection end line. + + + + + + @@ -354,6 +394,16 @@ Triggers a right-click menu action by the specified index. See [enum MenuItems] for a list of available indexes. + + + + + + + + + + @@ -611,6 +661,14 @@ + + + + + + + + diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index e0e9c6e2d12..bf328e50e72 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -930,7 +930,7 @@ void CodeTextEditor::update_editor_settings() { text_editor->set_highlight_current_line(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_current_line")); text_editor->set_indent_using_spaces(EditorSettings::get_singleton()->get("text_editor/indent/type")); text_editor->set_indent_size(EditorSettings::get_singleton()->get("text_editor/indent/size")); - text_editor->set_auto_indent(EditorSettings::get_singleton()->get("text_editor/indent/auto_indent")); + text_editor->set_auto_indent_enabled(EditorSettings::get_singleton()->get("text_editor/indent/auto_indent")); text_editor->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs")); text_editor->set_draw_spaces(EditorSettings::get_singleton()->get("text_editor/indent/draw_spaces")); text_editor->set_smooth_scroll_enabled(EditorSettings::get_singleton()->get("text_editor/navigation/smooth_scrolling")); @@ -1255,7 +1255,7 @@ void CodeTextEditor::_delete_line(int p_line) { text_editor->cursor_set_line(1); text_editor->cursor_set_column(0); } - text_editor->backspace_at_cursor(); + text_editor->backspace(); text_editor->unfold_line(p_line); text_editor->cursor_set_line(p_line); } @@ -1809,7 +1809,7 @@ CodeTextEditor::CodeTextEditor() { text_editor->set_draw_line_numbers(true); text_editor->set_brace_matching(true); - text_editor->set_auto_indent(true); + text_editor->set_auto_indent_enabled(true); status_bar = memnew(HBoxContainer); add_child(status_bar); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index b36e198b7ba..5fc1f74089e 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -524,7 +524,7 @@ void ScriptTextEditor::_validate_script() { if (safe_lines.has(i + 1)) { te->set_line_gutter_item_color(i, line_number_gutter, safe_line_number_color); last_is_safe = true; - } else if (last_is_safe && (te->is_line_comment(i) || te->get_line(i).strip_edges().is_empty())) { + } else if (last_is_safe && (te->is_in_comment(i) != -1 || te->get_line(i).strip_edges().is_empty())) { te->set_line_gutter_item_color(i, line_number_gutter, safe_line_number_color); } else { te->set_line_gutter_item_color(i, line_number_gutter, default_line_number_color); @@ -1038,7 +1038,7 @@ void ScriptTextEditor::_edit_option(int p_op) { return; } - tx->indent_selected_lines_left(); + tx->unindent_lines(); } break; case EDIT_INDENT_RIGHT: { Ref