aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/popupmenu.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-03-11 13:19:49 +0100
committerbfredl <bjorn.linse@gmail.com>2024-03-13 07:19:59 +0100
commit08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9 (patch)
tree73da66dcd1ba85b22d88b547b58f920039b167ad /src/nvim/popupmenu.c
parentd5488633f68fcfd58b4bcad654ab103b4746204b (diff)
downloadrneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.tar.gz
rneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.tar.bz2
rneovim-08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9.zip
fix(api/buffer): fix handling of viewport of non-current buffer
A lot of functions in move.c only worked for curwin, alternatively took a `wp` arg but still only work if that happens to be curwin. Refactor those that are needed for update_topline(wp) to work for any window. fixes #27723 fixes #27720
Diffstat (limited to 'src/nvim/popupmenu.c')
-rw-r--r--src/nvim/popupmenu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/popupmenu.c b/src/nvim/popupmenu.c
index e34d6fd97f..5e8fb7f5de 100644
--- a/src/nvim/popupmenu.c
+++ b/src/nvim/popupmenu.c
@@ -140,7 +140,7 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, i
// to avoid that must_redraw is set when 'cursorcolumn' is on.
pum_is_visible = true;
pum_is_drawn = true;
- validate_cursor_col();
+ validate_cursor_col(curwin);
int above_row = 0;
int below_row = cmdline_row;
@@ -273,7 +273,7 @@ void pum_display(pumitem_T *array, int size, int selected, bool array_changed, i
context_lines = 0;
} else {
// Leave two lines of context if possible
- validate_cheight();
+ validate_cheight(curwin);
if (curwin->w_cline_row + curwin->w_cline_height - curwin->w_wrow >= 3) {
context_lines = 3;
} else {
@@ -995,7 +995,7 @@ static bool pum_set_selected(int n, int repeat)
}
// Return cursor to where we were
- validate_cursor();
+ validate_cursor(curwin);
redraw_later(curwin, UPD_SOME_VALID);
// When the preview window was resized we need to