From 8830e53fe112dfb8adf2625dcebef8926760e8b6 Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Sun, 24 Nov 2019 10:48:04 +0100 Subject: Fixed index out of size error in TextEdit when opening scripts --- scene/gui/text_edit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'scene') 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); -- cgit v1.2.3