From 2beaae4b6f1c4a2c3833a5e205157fd3be2fcabc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 11 Nov 2021 09:08:08 +0100 Subject: String: Remove `erase` method, bindings can't mutate String --- editor/plugins/script_text_editor.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'editor/plugins/script_text_editor.cpp') diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index a655420d27..a5088a5246 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1629,10 +1629,7 @@ void ScriptTextEditor::_color_changed(const Color &p_color) { } String line = code_editor->get_text_editor()->get_line(color_position.x); - int color_args_pos = line.find(color_args, color_position.y); - String line_with_replaced_args = line; - line_with_replaced_args.erase(color_args_pos, color_args.length()); - line_with_replaced_args = line_with_replaced_args.insert(color_args_pos, new_args); + String line_with_replaced_args = line.replace(color_args, new_args); color_args = new_args; code_editor->get_text_editor()->begin_complex_operation(); -- cgit v1.2.3