summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Haas <liu.gam3@gmail.com>2017-12-04 18:27:42 +0100
committerAndreas Haas <liu.gam3@gmail.com>2017-12-04 18:33:43 +0100
commitfaaa012b843466805a41f90edf69442c69a3aeea (patch)
tree863577445c703c481767419f1064277dd904e43d
parent1a317a39edbad6452a17d1c5c3b6e2da51ca2e91 (diff)
downloadredot-engine-faaa012b843466805a41f90edf69442c69a3aeea.tar.gz
Script Editor: Use first non-whitespace comment delimiter.
As suggested by @neikeq in https://github.com/godotengine/godot/pull/13489#issuecomment-348690816
-rw-r--r--editor/plugins/script_text_editor.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 19293360ed..3a443e1bf7 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1042,8 +1042,13 @@ void ScriptTextEditor::_edit_option(int p_op) {
String delimiter = "#";
List<String> comment_delimiters;
scr->get_language()->get_comment_delimiters(&comment_delimiters);
- if (!comment_delimiters.empty()) {
- delimiter = comment_delimiters.front()->get();
+
+ for (List<String>::Element *E = comment_delimiters.front(); E; E = E->next()) {
+ String script_delimiter = E->get();
+ if (script_delimiter.find(" ") == -1) {
+ delimiter = script_delimiter;
+ break;
+ }
}
tx->begin_complex_operation();