소스 검색

Fixed index out of size error in TextEdit when opening scripts

PouleyKetchoupp 5 년 전
부모
커밋
8830e53fe1
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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);