Explorar o código

Fixed index out of size error in TextEdit when opening scripts

PouleyKetchoupp %!s(int64=5) %!d(string=hai) anos
pai
achega
8830e53fe1
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      scene/gui/text_edit.cpp

+ 1 - 0
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);