File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -309,8 +309,8 @@ popup_dialog({what}, {options}) *popup_dialog()*
309309
310310 popup_filter_menu({id} , {key} ) *popup_filter_menu()*
311311 Filter that can be used for a popup. These keys can be used:
312- j <Down> select item below
313- k <Up> select item above
312+ j <Down> <C-N> select item below
313+ k <Up> <C-P> select item above
314314 <Space> <Enter> accept current selection
315315 x Esc CTRL-C cancel the menu
316316 Other keys are ignored.
Original file line number Diff line number Diff line change @@ -2380,9 +2380,10 @@ f_popup_filter_menu(typval_T *argvars, typval_T *rettv)
23802380 res .v_type = VAR_NUMBER ;
23812381
23822382 old_lnum = wp -> w_cursor .lnum ;
2383- if ((c == 'k' || c == 'K' || c == K_UP ) && wp -> w_cursor .lnum > 1 )
2383+ if ((c == 'k' || c == 'K' || c == K_UP || c == Ctrl_P )
2384+ && wp -> w_cursor .lnum > 1 )
23842385 -- wp -> w_cursor .lnum ;
2385- if ((c == 'j' || c == 'J' || c == K_DOWN )
2386+ if ((c == 'j' || c == 'J' || c == K_DOWN || c == Ctrl_N )
23862387 && wp -> w_cursor .lnum < wp -> w_buffer -> b_ml .ml_line_count )
23872388 ++ wp -> w_cursor .lnum ;
23882389 if (old_lnum != wp -> w_cursor .lnum )
Original file line number Diff line number Diff line change @@ -3797,4 +3797,10 @@ func Test_popupwin_exiting_terminal()
37973797 endtry
37983798endfunc
37993799
3800+ func Test_popup_filter_menu ()
3801+ let colors = [' red' , ' green' , ' blue' ]
3802+ call popup_menu (colors, #{callback: {_, result - > assert_equal (' green' , colors[result - 1 ])}})
3803+ call feedkeys (" \<c-n>\<c-n>\<c-p>\<cr> " , ' xt' )
3804+ endfunc
3805+
38003806" vim: shiftwidth = 2 sts = 2
Original file line number Diff line number Diff line change @@ -750,6 +750,8 @@ static char *(features[]) =
750750
751751static int included_patches [] =
752752{ /* Add new patch number below this line */
753+ /**/
754+ 2296 ,
753755/**/
754756 2295 ,
755757/**/
You can’t perform that action at this time.
0 commit comments