Patch 8.2.4585

5 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 17, 2022, 9:03:57 AM3/17/22
to vim...@googlegroups.com

Patch 8.2.4585
Problem: Cannot use keypad page-up/down for completion menu.
Solution: Recognize the keypad keys. (Yegappan Lakshmanan, closes #9963)
Files: src/ex_getln.c, src/testdir/test_cmdline.vim


*** ../vim-8.2.4584/src/ex_getln.c 2022-03-16 13:33:22.074467978 +0000
--- src/ex_getln.c 2022-03-17 13:00:03.943939278 +0000
***************
*** 1606,1611 ****
--- 1606,1612 ----
cmdline_info_T save_ccline;
int did_save_ccline = FALSE;
int cmdline_type;
+ int wild_type;

if (ccline.cmdbuff != NULL)
{
***************
*** 1867,1876 ****
// text.
if (c == Ctrl_E || c == Ctrl_Y)
{
- int wild_type;
-
wild_type = (c == Ctrl_E) ? WILD_CANCEL : WILD_APPLY;
-
if (nextwild(&xpc, wild_type, WILD_NO_BEEP,
firstc != '@') == FAIL)
break;
--- 1868,1874 ----
***************
*** 2304,2311 ****
case Ctrl_P: // previous match
if (xpc.xp_numfiles > 0)
{
! if (nextwild(&xpc, (c == Ctrl_P) ? WILD_PREV : WILD_NEXT,
! 0, firstc != '@') == FAIL)
break;
goto cmdline_not_changed;
}
--- 2302,2309 ----
case Ctrl_P: // previous match
if (xpc.xp_numfiles > 0)
{
! wild_type = (c == Ctrl_P) ? WILD_PREV : WILD_NEXT;
! if (nextwild(&xpc, wild_type, 0, firstc != '@') == FAIL)
break;
goto cmdline_not_changed;
}
***************
*** 2325,2333 ****
{
// If the popup menu is displayed, then PageUp and PageDown
// are used to scroll the menu.
! if (nextwild(&xpc,
! (c == K_PAGEUP) ? WILD_PAGEUP : WILD_PAGEDOWN,
! 0, firstc != '@') == FAIL)
break;
goto cmdline_not_changed;
}
--- 2323,2332 ----
{
// If the popup menu is displayed, then PageUp and PageDown
// are used to scroll the menu.
! wild_type = WILD_PAGEUP;
! if (c == K_PAGEDOWN || c == K_KPAGEDOWN)
! wild_type = WILD_PAGEDOWN;
! if (nextwild(&xpc, wild_type, 0, firstc != '@') == FAIL)
break;
goto cmdline_not_changed;
}
*** ../vim-8.2.4584/src/testdir/test_cmdline.vim 2022-03-17 11:46:51.651820164 +0000
--- src/testdir/test_cmdline.vim 2022-03-17 13:00:03.943939278 +0000
***************
*** 2106,2112 ****
endfunc

" Test for recalling newer or older cmdline from history with <Up>, <Down>,
! " <S-Up>, <S-Down>, <PageUp>, <PageDown>, <C-p>, or <C-n>.
func Test_recalling_cmdline()
CheckFeature cmdline_hist

--- 2106,2113 ----
endfunc

" Test for recalling newer or older cmdline from history with <Up>, <Down>,
! " <S-Up>, <S-Down>, <PageUp>, <PageDown>, <kPageUp>, <kPageDown>, <C-p>, or
! " <C-n>.
func Test_recalling_cmdline()
CheckFeature cmdline_hist

***************
*** 2114,2130 ****
cnoremap <Plug>(save-cmdline) <Cmd>let g:cmdlines += [getcmdline()]<CR>

let histories = [
! \ {'name': 'cmd', 'enter': ':', 'exit': "\<Esc>"},
! \ {'name': 'search', 'enter': '/', 'exit': "\<Esc>"},
! \ {'name': 'expr', 'enter': ":\<C-r>=", 'exit': "\<Esc>\<Esc>"},
! \ {'name': 'input', 'enter': ":call input('')\<CR>", 'exit': "\<CR>"},
"\ TODO: {'name': 'debug', ...}
\]
let keypairs = [
! \ {'older': "\<Up>", 'newer': "\<Down>", 'prefixmatch': v:true},
! \ {'older': "\<S-Up>", 'newer': "\<S-Down>", 'prefixmatch': v:false},
! \ {'older': "\<PageUp>", 'newer': "\<PageDown>", 'prefixmatch': v:false},
! \ {'older': "\<C-p>", 'newer': "\<C-n>", 'prefixmatch': v:false},
\]
let prefix = 'vi'
for h in histories
--- 2115,2132 ----
cnoremap <Plug>(save-cmdline) <Cmd>let g:cmdlines += [getcmdline()]<CR>

let histories = [
! \ #{name: 'cmd', enter: ':', exit: "\<Esc>"},
! \ #{name: 'search', enter: '/', exit: "\<Esc>"},
! \ #{name: 'expr', enter: ":\<C-r>=", exit: "\<Esc>\<Esc>"},
! \ #{name: 'input', enter: ":call input('')\<CR>", exit: "\<CR>"},
"\ TODO: {'name': 'debug', ...}
\]
let keypairs = [
! \ #{older: "\<Up>", newer: "\<Down>", prefixmatch: v:true},
! \ #{older: "\<S-Up>", newer: "\<S-Down>", prefixmatch: v:false},
! \ #{older: "\<PageUp>", newer: "\<PageDown>", prefixmatch: v:false},
! \ #{older: "\<kPageUp>", newer: "\<kPageDown>", prefixmatch: v:false},
! \ #{older: "\<C-p>", newer: "\<C-n>", prefixmatch: v:false},
\]
let prefix = 'vi'
for h in histories
*** ../vim-8.2.4584/src/version.c 2022-03-17 11:46:51.651820164 +0000
--- src/version.c 2022-03-17 13:01:19.683738771 +0000
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4585,
/**/

--
He was not in the least bit scared to be mashed into a pulp
Or to have his eyes gouged out and his elbows broken;
To have his kneecaps split and his body burned away
And his limbs all hacked and mangled, brave Sir Robin.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages