summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-06 09:39:10 +0100
committerGitHub <noreply@github.com>2022-01-06 09:39:10 +0100
commitad07a339ee686b175382ebf603f72fbb6d745cb1 (patch)
tree133dfff3105a7150675247f3099a3e549f2769cb
parent0157742422c5f17e49237ecdfc643e943de31412 (diff)
parenteb95cdd690f7dc6526f0ee1c3eaaf304a5a92372 (diff)
Merge pull request #56504 from Chaosus/fix_code_editor_goto_error
-rw-r--r--editor/code_editor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index a1704e37a7..4669e56e20 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1548,7 +1548,9 @@ void CodeTextEditor::set_error_pos(int p_line, int p_column) {
void CodeTextEditor::goto_error() {
if (!error->get_text().is_empty()) {
- text_editor->unfold_line(error_line);
+ if (text_editor->get_line_count() != error_line) {
+ text_editor->unfold_line(error_line);
+ }
text_editor->set_caret_line(error_line);
text_editor->set_caret_column(error_column);
text_editor->center_viewport_to_caret();