summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-11-24 10:48:04 +0100
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-11-24 10:48:04 +0100
commit8830e53fe112dfb8adf2625dcebef8926760e8b6 (patch)
treed90dcd62ba17ff20f345cbdcbc76c7c01619b4ca
parent636bc5c32f07050fb387a7f8f5f78f7dc9aef7be (diff)
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);