summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-11-25 14:14:06 +0100
committerGitHub <noreply@github.com>2019-11-25 14:14:06 +0100
commit397fc4b9a65ca21419ab2e9395260cf4699b3dcb (patch)
tree798a4b0e877219b7f8d250097c9e0f50c1944136
parentd422eff03604ff5ea10692e71c92f0d79a6d9355 (diff)
parent8830e53fe112dfb8adf2625dcebef8926760e8b6 (diff)
Merge pull request #33856 from nekomatata/script-editor-text-edit-error
Fixed index out of size error in TextEdit when opening scripts
-rw-r--r--scene/gui/text_edit.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 8ddc31745e..b997d7a064 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4593,6 +4593,7 @@ void TextEdit::_scroll_moved(double p_to_val) {
break;
}
}
+ n_line = MIN(n_line, text.size() - 1);
int line_wrap_amount = times_line_wraps(n_line);
int wi = line_wrap_amount - (sc - v_scroll_i - 1);
wi = CLAMP(wi, 0, line_wrap_amount);