mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 8.2.4585: cannot use keypad page-up/down for completion menu
Problem: Cannot use keypad page-up/down for completion menu. Solution: Recognize the keypad keys. (Yegappan Lakshmanan, closes #9963)
This commit is contained in:
committed by
Bram Moolenaar
parent
da6d42c35a
commit
155b088208
@@ -1606,6 +1606,7 @@ getcmdline_int(
|
|||||||
cmdline_info_T save_ccline;
|
cmdline_info_T save_ccline;
|
||||||
int did_save_ccline = FALSE;
|
int did_save_ccline = FALSE;
|
||||||
int cmdline_type;
|
int cmdline_type;
|
||||||
|
int wild_type;
|
||||||
|
|
||||||
if (ccline.cmdbuff != NULL)
|
if (ccline.cmdbuff != NULL)
|
||||||
{
|
{
|
||||||
@@ -1867,10 +1868,7 @@ getcmdline_int(
|
|||||||
// text.
|
// text.
|
||||||
if (c == Ctrl_E || c == Ctrl_Y)
|
if (c == Ctrl_E || c == Ctrl_Y)
|
||||||
{
|
{
|
||||||
int wild_type;
|
|
||||||
|
|
||||||
wild_type = (c == Ctrl_E) ? WILD_CANCEL : WILD_APPLY;
|
wild_type = (c == Ctrl_E) ? WILD_CANCEL : WILD_APPLY;
|
||||||
|
|
||||||
if (nextwild(&xpc, wild_type, WILD_NO_BEEP,
|
if (nextwild(&xpc, wild_type, WILD_NO_BEEP,
|
||||||
firstc != '@') == FAIL)
|
firstc != '@') == FAIL)
|
||||||
break;
|
break;
|
||||||
@@ -2304,8 +2302,8 @@ getcmdline_int(
|
|||||||
case Ctrl_P: // previous match
|
case Ctrl_P: // previous match
|
||||||
if (xpc.xp_numfiles > 0)
|
if (xpc.xp_numfiles > 0)
|
||||||
{
|
{
|
||||||
if (nextwild(&xpc, (c == Ctrl_P) ? WILD_PREV : WILD_NEXT,
|
wild_type = (c == Ctrl_P) ? WILD_PREV : WILD_NEXT;
|
||||||
0, firstc != '@') == FAIL)
|
if (nextwild(&xpc, wild_type, 0, firstc != '@') == FAIL)
|
||||||
break;
|
break;
|
||||||
goto cmdline_not_changed;
|
goto cmdline_not_changed;
|
||||||
}
|
}
|
||||||
@@ -2325,9 +2323,10 @@ getcmdline_int(
|
|||||||
{
|
{
|
||||||
// If the popup menu is displayed, then PageUp and PageDown
|
// If the popup menu is displayed, then PageUp and PageDown
|
||||||
// are used to scroll the menu.
|
// are used to scroll the menu.
|
||||||
if (nextwild(&xpc,
|
wild_type = WILD_PAGEUP;
|
||||||
(c == K_PAGEUP) ? WILD_PAGEUP : WILD_PAGEDOWN,
|
if (c == K_PAGEDOWN || c == K_KPAGEDOWN)
|
||||||
0, firstc != '@') == FAIL)
|
wild_type = WILD_PAGEDOWN;
|
||||||
|
if (nextwild(&xpc, wild_type, 0, firstc != '@') == FAIL)
|
||||||
break;
|
break;
|
||||||
goto cmdline_not_changed;
|
goto cmdline_not_changed;
|
||||||
}
|
}
|
||||||
|
@@ -2106,7 +2106,8 @@ func Test_wildmenu_dirstack()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for recalling newer or older cmdline from history with <Up>, <Down>,
|
" Test for recalling newer or older cmdline from history with <Up>, <Down>,
|
||||||
" <S-Up>, <S-Down>, <PageUp>, <PageDown>, <C-p>, or <C-n>.
|
" <S-Up>, <S-Down>, <PageUp>, <PageDown>, <kPageUp>, <kPageDown>, <C-p>, or
|
||||||
|
" <C-n>.
|
||||||
func Test_recalling_cmdline()
|
func Test_recalling_cmdline()
|
||||||
CheckFeature cmdline_hist
|
CheckFeature cmdline_hist
|
||||||
|
|
||||||
@@ -2114,17 +2115,18 @@ func Test_recalling_cmdline()
|
|||||||
cnoremap <Plug>(save-cmdline) <Cmd>let g:cmdlines += [getcmdline()]<CR>
|
cnoremap <Plug>(save-cmdline) <Cmd>let g:cmdlines += [getcmdline()]<CR>
|
||||||
|
|
||||||
let histories = [
|
let histories = [
|
||||||
\ {'name': 'cmd', 'enter': ':', 'exit': "\<Esc>"},
|
\ #{name: 'cmd', enter: ':', exit: "\<Esc>"},
|
||||||
\ {'name': 'search', 'enter': '/', 'exit': "\<Esc>"},
|
\ #{name: 'search', enter: '/', exit: "\<Esc>"},
|
||||||
\ {'name': 'expr', 'enter': ":\<C-r>=", 'exit': "\<Esc>\<Esc>"},
|
\ #{name: 'expr', enter: ":\<C-r>=", exit: "\<Esc>\<Esc>"},
|
||||||
\ {'name': 'input', 'enter': ":call input('')\<CR>", 'exit': "\<CR>"},
|
\ #{name: 'input', enter: ":call input('')\<CR>", exit: "\<CR>"},
|
||||||
"\ TODO: {'name': 'debug', ...}
|
"\ TODO: {'name': 'debug', ...}
|
||||||
\]
|
\]
|
||||||
let keypairs = [
|
let keypairs = [
|
||||||
\ {'older': "\<Up>", 'newer': "\<Down>", 'prefixmatch': v:true},
|
\ #{older: "\<Up>", newer: "\<Down>", prefixmatch: v:true},
|
||||||
\ {'older': "\<S-Up>", 'newer': "\<S-Down>", 'prefixmatch': v:false},
|
\ #{older: "\<S-Up>", newer: "\<S-Down>", prefixmatch: v:false},
|
||||||
\ {'older': "\<PageUp>", 'newer': "\<PageDown>", 'prefixmatch': v:false},
|
\ #{older: "\<PageUp>", newer: "\<PageDown>", prefixmatch: v:false},
|
||||||
\ {'older': "\<C-p>", 'newer': "\<C-n>", 'prefixmatch': v:false},
|
\ #{older: "\<kPageUp>", newer: "\<kPageDown>", prefixmatch: v:false},
|
||||||
|
\ #{older: "\<C-p>", newer: "\<C-n>", prefixmatch: v:false},
|
||||||
\]
|
\]
|
||||||
let prefix = 'vi'
|
let prefix = 'vi'
|
||||||
for h in histories
|
for h in histories
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4585,
|
||||||
/**/
|
/**/
|
||||||
4584,
|
4584,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user