Script Editor: Use first non-whitespace comment delimiter.

As suggested by @neikeq in https://github.com/godotengine/godot/pull/13489#issuecomment-348690816
This commit is contained in:
Andreas Haas 2017-12-04 18:27:42 +01:00
parent 1a317a39ed
commit faaa012b84
No known key found for this signature in database
GPG Key ID: B5FFAE1B65FBD2E1

View File

@ -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();