mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0402: :map completion does not have <special>
Problem: :map completion does not have <special>. (Dominique Pelle) Solution: Recognize <special> in completion. Add a test.
This commit is contained in:
@@ -4216,6 +4216,11 @@ set_context_in_map_cmd(
|
|||||||
arg = skipwhite(arg + 8);
|
arg = skipwhite(arg + 8);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (STRNCMP(arg, "<special>", 9) == 0)
|
||||||
|
{
|
||||||
|
arg = skipwhite(arg + 9);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
if (STRNCMP(arg, "<script>", 8) == 0)
|
if (STRNCMP(arg, "<script>", 8) == 0)
|
||||||
{
|
{
|
||||||
@@ -4267,7 +4272,7 @@ ExpandMappings(
|
|||||||
{
|
{
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
for (i = 0; i < 6; ++i)
|
for (i = 0; i < 7; ++i)
|
||||||
{
|
{
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
p = (char_u *)"<silent>";
|
p = (char_u *)"<silent>";
|
||||||
@@ -4285,6 +4290,8 @@ ExpandMappings(
|
|||||||
#endif
|
#endif
|
||||||
else if (i == 5)
|
else if (i == 5)
|
||||||
p = (char_u *)"<nowait>";
|
p = (char_u *)"<nowait>";
|
||||||
|
else if (i == 6)
|
||||||
|
p = (char_u *)"<special>";
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -25,6 +25,26 @@ func Test_complete_wildmenu()
|
|||||||
set nowildmenu
|
set nowildmenu
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_map_completion()
|
||||||
|
if !has('cmdline_compl')
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
call feedkeys(":map <unique> <si\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"map <unique> <silent>', getreg(':'))
|
||||||
|
call feedkeys(":map <script> <un\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"map <script> <unique>', getreg(':'))
|
||||||
|
call feedkeys(":map <expr> <sc\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"map <expr> <script>', getreg(':'))
|
||||||
|
call feedkeys(":map <buffer> <e\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"map <buffer> <expr>', getreg(':'))
|
||||||
|
call feedkeys(":map <nowait> <b\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"map <nowait> <buffer>', getreg(':'))
|
||||||
|
call feedkeys(":map <special> <no\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"map <special> <nowait>', getreg(':'))
|
||||||
|
call feedkeys(":map <silent> <sp\<Tab>\<Home>\"\<CR>", 'xt')
|
||||||
|
call assert_equal('"map <silent> <special>', getreg(':'))
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_match_completion()
|
func Test_match_completion()
|
||||||
if !has('cmdline_compl')
|
if !has('cmdline_compl')
|
||||||
return
|
return
|
||||||
|
@@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
402,
|
||||||
/**/
|
/**/
|
||||||
401,
|
401,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user