You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
CodeEditor: Make possible to select and copy error text
This commit is contained in:
committed by
Rémi Verschelde
parent
03bd8ba9c2
commit
db9b8ff003
@@ -819,10 +819,12 @@ void ScriptTextEditor::_validate_script() {
|
||||
}
|
||||
|
||||
if (errors.size() > 0) {
|
||||
// TRANSLATORS: Script error pointing to a line and column number.
|
||||
String error_text = vformat(TTR("Error at (%d, %d):"), errors.front()->get().line, errors.front()->get().column) + " " + errors.front()->get().message;
|
||||
const int line = errors.front()->get().line;
|
||||
const int column = errors.front()->get().column;
|
||||
const String message = errors.front()->get().message.replace("[", "[lb]");
|
||||
const String error_text = vformat(TTR("Error at ([hint=Line %d, column %d]%d, %d[/hint]):"), line, column, line, column) + " " + message;
|
||||
code_editor->set_error(error_text);
|
||||
code_editor->set_error_pos(errors.front()->get().line - 1, errors.front()->get().column - 1);
|
||||
code_editor->set_error_pos(line - 1, column - 1);
|
||||
}
|
||||
script_is_valid = false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user