From 8f5fd0884b4424d028feef1bccd018a48c93a59c Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Mon, 8 Apr 2024 22:40:55 +0200 Subject: vim-patch:9.1.0280: several issues with 'smoothscroll' support Problem: Logic to make sure cursor is in visible part of the screen after scrolling the text with 'smoothscroll' is scattered, asymmetric and contains bugs. Solution: Adjust and create helper function for 'smoothscroll' cursor logic. (Luuk van Baal) https://github.com/vim/vim/commit/9148ba8a46baa3934c44164989cdcdec5d01d9e3 --- src/nvim/change.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/change.c') diff --git a/src/nvim/change.c b/src/nvim/change.c index 4d6c4acd0e..d76baaff2c 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -342,7 +342,7 @@ static void changed_common(buf_T *buf, linenr_T lnum, colnr_T col, linenr_T lnum && (last < wp->w_topline || (wp->w_topline >= lnum && wp->w_topline < lnume - && win_linetabsize(wp, wp->w_topline, ml_get(wp->w_topline), MAXCOL) + && win_linetabsize(wp, wp->w_topline, ml_get_buf(buf, wp->w_topline), MAXCOL) <= (wp->w_skipcol + sms_marker_overlap(wp, -1))))) { wp->w_skipcol = 0; } -- cgit