From b08c588238d900c6a647acbd7fed76e5428f6382 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 1 Aug 2026 08:28:28 +0800 Subject: [PATCH] vim-patch:9.2.0884: scroll: unreachable 'smoothscroll' code in cursor_correct() Problem: cursor_correct() checks for 'smoothscroll' with 'wrap' off, a combination where 'smoothscroll' has no effect. Solution: Remove the check, adjust_skipcol() already handles the case where the cursor line just fits in the window. closes: vim/vim#20891 https://github.com/vim/vim/commit/2ea497f072f102220a683822fd201bfb530894b2 Co-authored-by: Hirohito Higashi Co-Authored-By: Claude Opus 5 (1M context) --- src/nvim/move.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/nvim/move.c b/src/nvim/move.c index 576a19c7f7..767c473eca 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -2332,16 +2332,6 @@ void cursor_correct(win_T *wp) return; } - if (wp->w_p_sms && !wp->w_p_wrap) { - // 'smoothscroll' is active - if (wp->w_cline_height == wp->w_view_height) { - // The cursor line just fits in the window, don't scroll. - reset_skipcol(wp); - return; - } - // TODO(vim): If the cursor line doesn't fit in the window then only adjust w_skipcol. - } - // Narrow down the area where the cursor can be put by taking lines from // the top and the bottom until: // - the desired context lines are found