Merge pull request #33856 from nekomatata/script-editor-text-edit-error

Fixed index out of size error in TextEdit when opening scripts
This commit is contained in:
Rémi Verschelde 2019-11-25 14:14:06 +01:00 committed by GitHub
commit 397fc4b9a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);