mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Limit error messages in CodeTextEditor to 2 lines length
This commit is contained in:
parent
7598b08ec2
commit
410d6eee45
1 changed files with 9 additions and 1 deletions
|
|
@ -1501,7 +1501,15 @@ Variant CodeTextEditor::get_navigation_state() {
|
|||
}
|
||||
|
||||
void CodeTextEditor::set_error(const String &p_error) {
|
||||
error->set_text(p_error);
|
||||
// Trim the error message if it is more than 2 lines long.
|
||||
if (p_error.count("\n") >= 2) {
|
||||
Vector<String> splits = p_error.split("\n");
|
||||
String trimmed_error = String("\n").join(splits.slice(0, 2));
|
||||
error->set_text(trimmed_error + "...");
|
||||
} else {
|
||||
error->set_text(p_error);
|
||||
}
|
||||
|
||||
if (!p_error.is_empty()) {
|
||||
error->set_default_cursor_shape(CURSOR_POINTING_HAND);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue