From 12f00535555f8ac94a3da2a561f51357502e7a6d Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 28 Jun 2021 17:14:44 +0100 Subject: Move auto brace completion to CodeEdit --- editor/plugins/script_text_editor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (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 65459d159d..1d636f1c48 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -205,6 +205,10 @@ void ScriptTextEditor::_set_theme_for_script() { String beg = string.get_slice(" ", 0); String end = string.get_slice_count(" ") > 1 ? string.get_slice(" ", 1) : String(); text_edit->add_string_delimiter(beg, end, end == ""); + + if (!end.is_empty() && !text_edit->has_auto_brace_completion_open_key(beg)) { + text_edit->add_auto_brace_completion_pair(beg, end); + } } List comments; @@ -214,6 +218,10 @@ void ScriptTextEditor::_set_theme_for_script() { String beg = comment.get_slice(" ", 0); String end = comment.get_slice_count(" ") > 1 ? comment.get_slice(" ", 1) : String(); text_edit->add_comment_delimiter(beg, end, end == ""); + + if (!end.is_empty() && !text_edit->has_auto_brace_completion_open_key(beg)) { + text_edit->add_auto_brace_completion_pair(beg, end); + } } } -- cgit v1.2.3