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/normal.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/normal.c')
-rw-r--r-- | src/nvim/normal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 0293bb4a73..95553ccc52 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -2629,7 +2629,7 @@ do_mouse ( /* Set global flag that we are extending the Visual area with mouse * dragging; temporarily minimize 'scrolloff'. */ - if (VIsual_active && is_drag && get_scrolloff_value()) { + if (VIsual_active && is_drag && get_scrolloff_value(curwin)) { // In the very first line, allow scrolling one line if (mouse_row == 0) { mouse_dragging = 2; @@ -4135,7 +4135,7 @@ void scroll_redraw(int up, long count) scrollup(count, true) : scrolldown(count, true); - if (get_scrolloff_value()) { + if (get_scrolloff_value(curwin)) { // Adjust the cursor position for 'scrolloff'. Mark w_topline as // valid, otherwise the screen jumps back at the end of the file. cursor_correct(); @@ -4185,7 +4185,7 @@ static void nv_zet(cmdarg_T *cap) int old_fen = curwin->w_p_fen; bool undo = false; - int l_p_siso = (int)get_sidescrolloff_value(); + int l_p_siso = (int)get_sidescrolloff_value(curwin); assert(l_p_siso <= INT_MAX); if (ascii_isdigit(nchar)) { |