summaryrefslogtreecommitdiffstats
path: root/editor/plugins/script_text_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r--editor/plugins/script_text_editor.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index eb934da4dd..6e97c62a7f 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -788,9 +788,7 @@ static void _find_changed_scripts_for_external_editor(Node *p_base, Node *p_curr
}
void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_for_script) {
- if (!bool(EDITOR_GET("text_editor/external/use_external_editor"))) {
- return;
- }
+ bool use_external_editor = bool(EDITOR_GET("text_editor/external/use_external_editor"));
ERR_FAIL_NULL(get_tree());
@@ -804,6 +802,10 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo
for (const Ref<Script> &E : scripts) {
Ref<Script> scr = E;
+ if (!use_external_editor && !scr->get_language()->overrides_external_editor()) {
+ continue; // We're not using an external editor for this script.
+ }
+
if (p_for_script.is_valid() && p_for_script != scr) {
continue;
}
@@ -1409,7 +1411,7 @@ void ScriptTextEditor::_edit_option(int p_op) {
PackedStringArray results;
for (int i = 0; i < lines.size(); i++) {
- String line = lines[i];
+ const String &line = lines[i];
String whitespace = line.substr(0, line.size() - line.strip_edges(true, false).size()); // Extract the whitespace at the beginning.
if (expression.parse(line) == OK) {
Variant result = expression.execute(Array(), Variant(), false, true);