1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2021-01-04 13:18:30 +01:00
parent d93a7fc1a9
commit 014f698cb6
4 changed files with 13 additions and 4 deletions

View File

@@ -2380,9 +2380,10 @@ f_popup_filter_menu(typval_T *argvars, typval_T *rettv)
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)