mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 18:36:30 +00:00
vim-patch:9.0.1247: divide by zero with 'smoothscroll' set and a narrow window
Problem: Divide by zero with 'smoothscroll' set and a narrow window.
Solution: Bail out when the window is too narrow.
870219c58c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1475,6 +1475,9 @@ void adjust_skipcol(void)
|
||||
}
|
||||
|
||||
int width1 = curwin->w_width - curwin_col_off();
|
||||
if (width1 <= 0) {
|
||||
return; // no text will be displayed
|
||||
}
|
||||
int width2 = width1 + curwin_col_off2();
|
||||
long so = get_scrolloff_value(curwin);
|
||||
long scrolloff_cols = so == 0 ? 0 : width1 + (so - 1) * width2;
|
||||
|
Reference in New Issue
Block a user