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.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 13b1c4b6ac..882ccce501 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -598,8 +598,7 @@ void ScriptTextEditor::_update_warnings() {
warnings_panel->push_cell();
warnings_panel->push_meta(w.start_line - 1);
warnings_panel->push_color(warnings_panel->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
- warnings_panel->add_text(TTR("Line") + " " + itos(w.start_line));
- warnings_panel->add_text(" (" + w.string_code + "):");
+ warnings_panel->add_text(vformat(TTR("Line %d (%s):"), w.start_line, w.string_code));
warnings_panel->pop(); // Color.
warnings_panel->pop(); // Meta goto.
warnings_panel->pop(); // Cell.
@@ -625,7 +624,7 @@ void ScriptTextEditor::_update_errors() {
errors_panel->push_cell();
errors_panel->push_meta(err.line - 1);
errors_panel->push_color(warnings_panel->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
- errors_panel->add_text(TTR("Line") + " " + itos(err.line) + ":");
+ errors_panel->add_text(vformat(TTR("Line %d:"), err.line));
errors_panel->pop(); // Color.
errors_panel->pop(); // Meta goto.
errors_panel->pop(); // Cell.
@@ -659,7 +658,7 @@ void ScriptTextEditor::_update_errors() {
errors_panel->push_cell();
errors_panel->push_meta(click_meta);
errors_panel->push_color(errors_panel->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
- errors_panel->add_text(TTR("Line") + " " + itos(err.line) + ":");
+ errors_panel->add_text(vformat(TTR("Line %d:"), err.line));
errors_panel->pop(); // Color.
errors_panel->pop(); // Meta goto.
errors_panel->pop(); // Cell.
@@ -1946,9 +1945,12 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
if (d.has("type") && String(d["type"]) == "obj_property") {
te->remove_secondary_carets();
+
+ bool add_literal = EDITOR_GET("text_editor/completion/add_node_path_literals");
+ String text_to_drop = add_literal ? "^" : "";
// It is unclear whether properties may contain single or double quotes.
// Assume here that double-quotes may not exist. We are escaping single-quotes if necessary.
- const String text_to_drop = _quote_drop_data(String(d["property"]));
+ text_to_drop += _quote_drop_data(String(d["property"]));
te->set_caret_line(row);
te->set_caret_column(col);