mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 18:36:30 +00:00
vim-patch:9.0.0998: "gk" may reset skipcol when not needed
Problem: "gk" may reset skipcol when not needed.
Solution: Only reset skipcol if the cursor column is less.
1b73edd9ee
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1776,7 +1776,7 @@ void scroll_cursor_top(int min_scroll, int always)
|
||||
scroll_cursor_halfway(false, false);
|
||||
} else {
|
||||
// If "always" is false, only adjust topline to a lower value, higher
|
||||
// value may happen with wrapping lines
|
||||
// value may happen with wrapping lines.
|
||||
if (new_topline < curwin->w_topline || always) {
|
||||
curwin->w_topline = new_topline;
|
||||
}
|
||||
@@ -1792,7 +1792,8 @@ void scroll_cursor_top(int min_scroll, int always)
|
||||
}
|
||||
check_topfill(curwin, false);
|
||||
// TODO(vim): if the line doesn't fit may optimize w_skipcol
|
||||
if (curwin->w_topline == curwin->w_cursor.lnum) {
|
||||
if (curwin->w_topline == curwin->w_cursor.lnum
|
||||
&& curwin->w_skipcol >= curwin->w_cursor.col) {
|
||||
reset_skipcol(curwin);
|
||||
}
|
||||
if (curwin->w_topline != old_topline
|
||||
|
Reference in New Issue
Block a user