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

2ea497f072

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
zeertzjq
2026-08-01 08:28:28 +08:00
parent d9525e23f3
commit b08c588238

View File

@@ -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