mirror of
https://github.com/neovim/neovim.git
synced 2026-09-11 00:15:56 +00:00
fix(options): 'scrolloffpad' reads the wrong window #41684
Problem:
`get_scrolloffpad_value()` takes a window, but its else branch reads
`curwin->w_p_sop` instead of `wp->w_p_sop`.
Reachable from Vimscript, since `line('w0', winid)` runs
`update_topline()` on another window without making it current.
Solution:
Read the option from the window that was passed in.
AI-assisted
This commit is contained in:
committed by
GitHub
parent
455b6a810c
commit
050fa30632
@@ -7151,7 +7151,7 @@ int64_t get_scrolloff_value(win_T *wp)
|
||||
/// global value when appropriate.
|
||||
int64_t get_scrolloffpad_value(win_T *wp)
|
||||
{
|
||||
return wp->w_p_sop == -1 ? p_sop : curwin->w_p_sop;
|
||||
return wp->w_p_sop == -1 ? p_sop : wp->w_p_sop;
|
||||
}
|
||||
|
||||
/// Return the effective 'sidescrolloff' value for the current window, using the
|
||||
|
||||
Reference in New Issue
Block a user