mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.2.381
Problem: No completion for :behave. Solution: Add :behave completion. Minor related fixes. (Dominique Pelle)
This commit is contained in:
parent
58cb0898a3
commit
42b4ddab95
@ -26,10 +26,12 @@ typedef struct ucmd
|
|||||||
long_u uc_argt; /* The argument type */
|
long_u uc_argt; /* The argument type */
|
||||||
char_u *uc_rep; /* The command's replacement string */
|
char_u *uc_rep; /* The command's replacement string */
|
||||||
long uc_def; /* The default value for a range/count */
|
long uc_def; /* The default value for a range/count */
|
||||||
scid_T uc_scriptID; /* SID where the command was defined */
|
|
||||||
int uc_compl; /* completion type */
|
int uc_compl; /* completion type */
|
||||||
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
# ifdef FEAT_EVAL
|
||||||
|
scid_T uc_scriptID; /* SID where the command was defined */
|
||||||
|
# ifdef FEAT_CMDL_COMPL
|
||||||
char_u *uc_compl_arg; /* completion argument if any */
|
char_u *uc_compl_arg; /* completion argument if any */
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
} ucmd_T;
|
} ucmd_T;
|
||||||
|
|
||||||
@ -3156,17 +3158,15 @@ set_one_cmd_context(xp, buff)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE;
|
for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE;
|
||||||
ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
|
ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
|
||||||
if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, (size_t)len) == 0)
|
if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd,
|
||||||
|
(size_t)len) == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef FEAT_USR_CMDS
|
#ifdef FEAT_USR_CMDS
|
||||||
if (cmd[0] >= 'A' && cmd[0] <= 'Z')
|
if (cmd[0] >= 'A' && cmd[0] <= 'Z')
|
||||||
{
|
|
||||||
while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */
|
while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */
|
||||||
++p;
|
++p;
|
||||||
len = (int)(p - cmd);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3809,6 +3809,9 @@ set_one_cmd_context(xp, buff)
|
|||||||
set_context_in_profile_cmd(xp, arg);
|
set_context_in_profile_cmd(xp, arg);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
case CMD_behave:
|
||||||
|
xp->xp_context = EXPAND_BEHAVE;
|
||||||
|
break;
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
#endif /* FEAT_CMDL_COMPL */
|
||||||
|
|
||||||
@ -10847,6 +10850,24 @@ ex_behave(eap)
|
|||||||
EMSG2(_(e_invarg2), eap->arg);
|
EMSG2(_(e_invarg2), eap->arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
||||||
|
/*
|
||||||
|
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||||
|
* ":behave {mswin,xterm}" command.
|
||||||
|
*/
|
||||||
|
char_u *
|
||||||
|
get_behave_arg(xp, idx)
|
||||||
|
expand_T *xp UNUSED;
|
||||||
|
int idx;
|
||||||
|
{
|
||||||
|
if (idx == 0)
|
||||||
|
return (char_u *)"mswin";
|
||||||
|
if (idx == 1)
|
||||||
|
return (char_u *)"xterm";
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#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;
|
||||||
|
@ -4492,6 +4492,7 @@ ExpandFromContext(xp, pat, num_file, file, options)
|
|||||||
} tab[] =
|
} tab[] =
|
||||||
{
|
{
|
||||||
{EXPAND_COMMANDS, get_command_name, FALSE},
|
{EXPAND_COMMANDS, get_command_name, FALSE},
|
||||||
|
{EXPAND_BEHAVE, get_behave_arg, TRUE},
|
||||||
#ifdef FEAT_USR_CMDS
|
#ifdef FEAT_USR_CMDS
|
||||||
{EXPAND_USER_COMMANDS, get_user_commands, FALSE},
|
{EXPAND_USER_COMMANDS, get_user_commands, FALSE},
|
||||||
{EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE},
|
{EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE},
|
||||||
|
@ -52,4 +52,5 @@ char_u *expand_sfile __ARGS((char_u *arg));
|
|||||||
int put_eol __ARGS((FILE *fd));
|
int put_eol __ARGS((FILE *fd));
|
||||||
int put_line __ARGS((FILE *fd, char *s));
|
int put_line __ARGS((FILE *fd, char *s));
|
||||||
void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
|
void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
|
||||||
|
char_u *get_behave_arg __ARGS((expand_T *xp, int idx));
|
||||||
/* vim: set ft=c : */
|
/* vim: set ft=c : */
|
||||||
|
@ -681,6 +681,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 */
|
||||||
|
/**/
|
||||||
|
381,
|
||||||
/**/
|
/**/
|
||||||
380,
|
380,
|
||||||
/**/
|
/**/
|
||||||
|
@ -595,7 +595,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Terminal highlighting attribute bits.
|
* Terminal highlighting attribute bits.
|
||||||
* Attibutes above HL_ALL are used for syntax highlighting.
|
* Attributes above HL_ALL are used for syntax highlighting.
|
||||||
*/
|
*/
|
||||||
#define HL_NORMAL 0x00
|
#define HL_NORMAL 0x00
|
||||||
#define HL_INVERSE 0x01
|
#define HL_INVERSE 0x01
|
||||||
@ -721,6 +721,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
|
|||||||
#define EXPAND_CSCOPE 33
|
#define EXPAND_CSCOPE 33
|
||||||
#define EXPAND_SIGN 34
|
#define EXPAND_SIGN 34
|
||||||
#define EXPAND_PROFILE 35
|
#define EXPAND_PROFILE 35
|
||||||
|
#define EXPAND_BEHAVE 36
|
||||||
|
|
||||||
/* Values for exmode_active (0 is no exmode) */
|
/* Values for exmode_active (0 is no exmode) */
|
||||||
#define EXMODE_NORMAL 1
|
#define EXMODE_NORMAL 1
|
||||||
@ -1262,7 +1263,7 @@ typedef enum
|
|||||||
} hlf_T;
|
} hlf_T;
|
||||||
|
|
||||||
/* The HL_FLAGS must be in the same order as the HLF_ enums!
|
/* The HL_FLAGS must be in the same order as the HLF_ enums!
|
||||||
* When chainging this also adjust the default for 'highlight'. */
|
* When changing this also adjust the default for 'highlight'. */
|
||||||
#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
|
#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
|
||||||
'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
|
'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
|
||||||
'f', 'F', 'A', 'C', 'D', 'T', '>', \
|
'f', 'F', 'A', 'C', 'D', 'T', '>', \
|
||||||
@ -1430,7 +1431,7 @@ typedef enum
|
|||||||
#ifdef FEAT_MBYTE
|
#ifdef FEAT_MBYTE
|
||||||
/* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
|
/* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
|
||||||
* encoding because mb_stricmp() takes care of all ascii and non-ascii
|
* encoding because mb_stricmp() takes care of all ascii and non-ascii
|
||||||
* encodings, including characters with umluats in latin1, etc., while
|
* encodings, including characters with umlauts in latin1, etc., while
|
||||||
* STRICMP() only handles the system locale version, which often does not
|
* STRICMP() only handles the system locale version, which often does not
|
||||||
* handle non-ascii properly. */
|
* handle non-ascii properly. */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user