mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
messages: fix crashes with scrollback
This commit is contained in:
@@ -2217,9 +2217,7 @@ void msg_scroll_up(bool may_throttle)
|
|||||||
/// we get throttling "for free" using standard redraw_win_later code paths.
|
/// we get throttling "for free" using standard redraw_win_later code paths.
|
||||||
void msg_scroll_flush(void)
|
void msg_scroll_flush(void)
|
||||||
{
|
{
|
||||||
if (!msg_grid.throttled) {
|
if (msg_grid.throttled) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
msg_grid.throttled = false;
|
msg_grid.throttled = false;
|
||||||
int pos_delta = msg_grid_pos_at_flush - msg_grid_pos;
|
int pos_delta = msg_grid_pos_at_flush - msg_grid_pos;
|
||||||
assert(pos_delta >= 0);
|
assert(pos_delta >= 0);
|
||||||
@@ -2227,7 +2225,6 @@ void msg_scroll_flush(void)
|
|||||||
|
|
||||||
if (pos_delta > 0) {
|
if (pos_delta > 0) {
|
||||||
ui_ext_msg_set_pos(msg_grid_pos, true);
|
ui_ext_msg_set_pos(msg_grid_pos, true);
|
||||||
msg_grid_pos_at_flush = msg_grid_pos;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int to_scroll = delta-pos_delta-msg_grid_scroll_discount;
|
int to_scroll = delta-pos_delta-msg_grid_scroll_discount;
|
||||||
@@ -2246,8 +2243,10 @@ void msg_scroll_flush(void)
|
|||||||
HL_ATTR(HLF_MSG), false);
|
HL_ATTR(HLF_MSG), false);
|
||||||
msg_grid.dirty_col[row] = 0;
|
msg_grid.dirty_col[row] = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
msg_scrolled_at_flush = msg_scrolled;
|
msg_scrolled_at_flush = msg_scrolled;
|
||||||
msg_grid_scroll_discount = 0;
|
msg_grid_scroll_discount = 0;
|
||||||
|
msg_grid_pos_at_flush = msg_grid_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void msg_reset_scroll(void)
|
void msg_reset_scroll(void)
|
||||||
|
Reference in New Issue
Block a user