diff options
author | Matthieu Coudron <mcoudron@hotmail.com> | 2020-12-23 16:21:10 +0100 |
---|---|---|
committer | Matthieu Coudron <mcoudron@hotmail.com> | 2020-12-23 16:21:10 +0100 |
commit | 4d9520ec86aaea607f0dc7f1630a82a1cdf9515a (patch) | |
tree | 3be455ca36108ecf32f09063f7505b2c1192a3e8 /src/nvim/option.c | |
parent | 5ce328df401bc5cafd66caeb265835b939028b7f (diff) | |
download | rneovim-4d9520ec86aaea607f0dc7f1630a82a1cdf9515a.tar.gz rneovim-4d9520ec86aaea607f0dc7f1630a82a1cdf9515a.tar.bz2 rneovim-4d9520ec86aaea607f0dc7f1630a82a1cdf9515a.zip |
refactor: pass the window to get_(side)scrolloff_value
to less rely on curwin
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 7cf8412269..dc2591510c 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -7159,20 +7159,20 @@ dict_T *get_winbuf_options(const int bufopt) /// Return the effective 'scrolloff' value for the current window, using the /// global value when appropriate. -long get_scrolloff_value(void) +long get_scrolloff_value(win_T *wp) { // Disallow scrolloff in terminal-mode. #11915 if (State & TERM_FOCUS) { return 0; } - return curwin->w_p_so < 0 ? p_so : curwin->w_p_so; + return wp->w_p_so < 0 ? p_so : wp->w_p_so; } /// Return the effective 'sidescrolloff' value for the current window, using the /// global value when appropriate. -long get_sidescrolloff_value(void) +long get_sidescrolloff_value(win_T *wp) { - return curwin->w_p_siso < 0 ? p_siso : curwin->w_p_siso; + return wp->w_p_siso < 0 ? p_siso : wp->w_p_siso; } Dictionary get_vimoption(String name, Error *err) |