patch 8.2.2296: cannot use CTRL-N and CTRL-P in a popup menu
Problem: Cannot use CTRL-N and CTRL-P in a popup menu.
Solution: Use CTRL-N like <Down> and CTRL-P like <Up>. (closes #7614)
diff --git a/src/popupwin.c b/src/popupwin.c
index 7896efd..fddcaa1 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -2380,9 +2380,10 @@
res.v_type = VAR_NUMBER;
old_lnum = wp->w_cursor.lnum;
- if ((c == 'k' || c == 'K' || c == K_UP) && wp->w_cursor.lnum > 1)
+ if ((c == 'k' || c == 'K' || c == K_UP || c == Ctrl_P)
+ && wp->w_cursor.lnum > 1)
--wp->w_cursor.lnum;
- if ((c == 'j' || c == 'J' || c == K_DOWN)
+ if ((c == 'j' || c == 'J' || c == K_DOWN || c == Ctrl_N)
&& wp->w_cursor.lnum < wp->w_buffer->b_ml.ml_line_count)
++wp->w_cursor.lnum;
if (old_lnum != wp->w_cursor.lnum)
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index bfc0494..7335c1c 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3797,4 +3797,10 @@
endtry
endfunc
+func Test_popup_filter_menu()
+ let colors = ['red', 'green', 'blue']
+ call popup_menu(colors, #{callback: {_, result -> assert_equal('green', colors[result - 1])}})
+ call feedkeys("\<c-n>\<c-n>\<c-p>\<cr>", 'xt')
+endfunc
+
" vim: shiftwidth=2 sts=2
diff --git a/src/version.c b/src/version.c
index 12877de..7be5728 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2296,
+/**/
2295,
/**/
2294,