mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.0.0878: no completion for :mapclear
Problem: No completion for :mapclear. Solution: Add completion (Nobuhiro Takasaki et al. closes #1943)
This commit is contained in:
@@ -4368,6 +4368,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
|||||||
highlight highlight groups
|
highlight highlight groups
|
||||||
history :history suboptions
|
history :history suboptions
|
||||||
locale locale names (as output of locale -a)
|
locale locale names (as output of locale -a)
|
||||||
|
mapclear buffer argument
|
||||||
mapping mapping name
|
mapping mapping name
|
||||||
menu menus
|
menu menus
|
||||||
messages |:messages| suboptions
|
messages |:messages| suboptions
|
||||||
|
@@ -1279,6 +1279,7 @@ completion can be enabled:
|
|||||||
-complete=highlight highlight groups
|
-complete=highlight highlight groups
|
||||||
-complete=history :history suboptions
|
-complete=history :history suboptions
|
||||||
-complete=locale locale names (as output of locale -a)
|
-complete=locale locale names (as output of locale -a)
|
||||||
|
-complete=mapclear buffer argument
|
||||||
-complete=mapping mapping name
|
-complete=mapping mapping name
|
||||||
-complete=menu menus
|
-complete=menu menus
|
||||||
-complete=messages |:messages| suboptions
|
-complete=messages |:messages| suboptions
|
||||||
|
@@ -4223,6 +4223,19 @@ set_one_cmd_context(
|
|||||||
case CMD_xunmap:
|
case CMD_xunmap:
|
||||||
return set_context_in_map_cmd(xp, cmd, arg, forceit,
|
return set_context_in_map_cmd(xp, cmd, arg, forceit,
|
||||||
FALSE, TRUE, ea.cmdidx);
|
FALSE, TRUE, ea.cmdidx);
|
||||||
|
case CMD_mapclear:
|
||||||
|
case CMD_nmapclear:
|
||||||
|
case CMD_vmapclear:
|
||||||
|
case CMD_omapclear:
|
||||||
|
case CMD_imapclear:
|
||||||
|
case CMD_cmapclear:
|
||||||
|
case CMD_lmapclear:
|
||||||
|
case CMD_smapclear:
|
||||||
|
case CMD_xmapclear:
|
||||||
|
xp->xp_context = EXPAND_MAPCLEAR;
|
||||||
|
xp->xp_pattern = arg;
|
||||||
|
break;
|
||||||
|
|
||||||
case CMD_abbreviate: case CMD_noreabbrev:
|
case CMD_abbreviate: case CMD_noreabbrev:
|
||||||
case CMD_cabbrev: case CMD_cnoreabbrev:
|
case CMD_cabbrev: case CMD_cnoreabbrev:
|
||||||
case CMD_iabbrev: case CMD_inoreabbrev:
|
case CMD_iabbrev: case CMD_inoreabbrev:
|
||||||
@@ -5964,6 +5977,7 @@ static struct
|
|||||||
&& (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
|
&& (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
|
||||||
{EXPAND_LOCALES, "locale"},
|
{EXPAND_LOCALES, "locale"},
|
||||||
#endif
|
#endif
|
||||||
|
{EXPAND_MAPCLEAR, "mapclear"},
|
||||||
{EXPAND_MAPPINGS, "mapping"},
|
{EXPAND_MAPPINGS, "mapping"},
|
||||||
{EXPAND_MENUS, "menu"},
|
{EXPAND_MENUS, "menu"},
|
||||||
{EXPAND_MESSAGES, "messages"},
|
{EXPAND_MESSAGES, "messages"},
|
||||||
@@ -12083,6 +12097,14 @@ get_messages_arg(expand_T *xp UNUSED, int idx)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
char_u *
|
||||||
|
get_mapclear_arg(expand_T *xp UNUSED, int idx)
|
||||||
|
{
|
||||||
|
if (idx == 0)
|
||||||
|
return (char_u *)"<buffer>";
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
static int filetype_detect = FALSE;
|
static int filetype_detect = FALSE;
|
||||||
static int filetype_plugin = FALSE;
|
static int filetype_plugin = FALSE;
|
||||||
|
@@ -4879,6 +4879,7 @@ ExpandFromContext(
|
|||||||
{
|
{
|
||||||
{EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
|
{EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
|
||||||
{EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
|
{EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
|
||||||
|
{EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE},
|
||||||
{EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE},
|
{EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE},
|
||||||
#ifdef FEAT_CMDHIST
|
#ifdef FEAT_CMDHIST
|
||||||
{EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
|
{EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
|
||||||
|
@@ -62,4 +62,5 @@ int put_line(FILE *fd, char *s);
|
|||||||
void dialog_msg(char_u *buff, char *format, char_u *fname);
|
void dialog_msg(char_u *buff, char *format, char_u *fname);
|
||||||
char_u *get_behave_arg(expand_T *xp, int idx);
|
char_u *get_behave_arg(expand_T *xp, int idx);
|
||||||
char_u *get_messages_arg(expand_T *xp, int idx);
|
char_u *get_messages_arg(expand_T *xp, int idx);
|
||||||
|
char_u *get_mapclear_arg(expand_T *xp, int idx);
|
||||||
/* vim: set ft=c : */
|
/* vim: set ft=c : */
|
||||||
|
@@ -222,6 +222,11 @@ func Test_getcompletion()
|
|||||||
let l = getcompletion('not', 'messages')
|
let l = getcompletion('not', 'messages')
|
||||||
call assert_equal([], l)
|
call assert_equal([], l)
|
||||||
|
|
||||||
|
let l = getcompletion('', 'mapclear')
|
||||||
|
call assert_true(index(l, '<buffer>') >= 0)
|
||||||
|
let l = getcompletion('not', 'mapclear')
|
||||||
|
call assert_equal([], l)
|
||||||
|
|
||||||
if has('cscope')
|
if has('cscope')
|
||||||
let l = getcompletion('', 'cscope')
|
let l = getcompletion('', 'cscope')
|
||||||
let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show']
|
let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show']
|
||||||
|
@@ -769,6 +769,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 */
|
||||||
|
/**/
|
||||||
|
878,
|
||||||
/**/
|
/**/
|
||||||
877,
|
877,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -808,6 +808,7 @@ extern int (*dyn_libintl_putenv)(const char *envstring);
|
|||||||
#define EXPAND_USER_ADDR_TYPE 44
|
#define EXPAND_USER_ADDR_TYPE 44
|
||||||
#define EXPAND_PACKADD 45
|
#define EXPAND_PACKADD 45
|
||||||
#define EXPAND_MESSAGES 46
|
#define EXPAND_MESSAGES 46
|
||||||
|
#define EXPAND_MAPCLEAR 47
|
||||||
|
|
||||||
/* Values for exmode_active (0 is no exmode) */
|
/* Values for exmode_active (0 is no exmode) */
|
||||||
#define EXMODE_NORMAL 1
|
#define EXMODE_NORMAL 1
|
||||||
|
Reference in New Issue
Block a user