summaryrefslogtreecommitdiff
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2021-06-28 17:14:44 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2021-08-01 12:06:33 +0100
commit12f00535555f8ac94a3da2a561f51357502e7a6d (patch)
treee67a80d7ce219f36eff952cd4b777744770b6b43 /editor/plugins/script_text_editor.cpp
parent80143c970136d72819be39c1eaaf800ae89c2cca (diff)
Move auto brace completion to CodeEdit
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp8
1 files changed, 8 insertions, 0 deletions
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<String> 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);
+ }
}
}