Fix crash on cursor resize

Fixes #3960.
This commit is contained in:
Christian Duerr 2020-07-14 00:30:17 +00:00 committed by GitHub
parent 18cf806a27
commit 5424b30d22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ impl<T: GridCell + Default + PartialEq + Copy> Grid<T> {
// Remove wide char spacer before shrinking.
let len = wrapped.len();
if wrapped[len - 1].flags().contains(Flags::LEADING_WIDE_CHAR_SPACER) {
if len > 0 && wrapped[len - 1].flags().contains(Flags::LEADING_WIDE_CHAR_SPACER) {
if len == 1 {
row[cols - 1].flags_mut().insert(Flags::WRAPLINE);
new_raw.push(row);