fix(terminal): don't disable scrolloff for non-terminal buffers (#34451)

This commit is contained in:
zeertzjq
2025-06-11 22:47:06 +08:00
committed by GitHub
parent de87ceb3be
commit 6a71239cd5
2 changed files with 30 additions and 1 deletions

View File

@@ -6321,7 +6321,8 @@ dict_T *get_winbuf_options(const int bufopt)
int get_scrolloff_value(win_T *wp)
{
// Disallow scrolloff in terminal-mode. #11915
if (State & MODE_TERMINAL) {
// Still allow 'scrolloff' for non-terminal buffers. #34447
if ((State & MODE_TERMINAL) && wp->w_buffer->terminal) {
return 0;
}
return (int)(wp->w_p_so < 0 ? p_so : wp->w_p_so);