mirror of
https://github.com/neovim/neovim.git
synced 2024-12-21 19:55:04 -07:00
vim-patch:8.0.0307
Problem: Asan detects a memory error when EXITFREE is defined. (Dominique
Pelle)
Solution: In getvcol() check for ml_get_buf() returning an empty string.
Also skip adjusting the scroll position. Set "exiting" in
mch_exit() for all systems.
955f198fc5
This commit is contained in:
parent
830b31683e
commit
c398402f12
@ -1160,6 +1160,11 @@ void getvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor,
|
||||
// continue until the NUL
|
||||
posptr = NULL;
|
||||
} else {
|
||||
// Special check for an empty line, which can happen on exit, when
|
||||
// ml_get_buf() always returns an empty string.
|
||||
if (*ptr == NUL) {
|
||||
pos->col = 0;
|
||||
}
|
||||
posptr = ptr + pos->col;
|
||||
}
|
||||
|
||||
|
@ -4803,7 +4803,11 @@ void win_new_height(win_T *wp, int height)
|
||||
wp->w_height = height;
|
||||
wp->w_skipcol = 0;
|
||||
|
||||
scroll_to_fraction(wp, prev_height);
|
||||
// There is no point in adjusting the scroll position when exiting. Some
|
||||
// values might be invalid.
|
||||
if (!exiting) {
|
||||
scroll_to_fraction(wp, prev_height);
|
||||
}
|
||||
}
|
||||
|
||||
void scroll_to_fraction(win_T *wp, int prev_height)
|
||||
|
Loading…
Reference in New Issue
Block a user