mirror of
https://github.com/zoriya/vim.git
synced 2025-12-20 06:05:18 +00:00
patch 8.1.1887: the +cmdline_compl feature is not in the tiny version
Problem: The +cmdline_compl feature is not in the tiny version. Solution: Graduate the +cmdline_compl feature.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
*cmdline.txt* For Vim version 8.1. Last change: 2019 Aug 06
|
*cmdline.txt* For Vim version 8.1. Last change: 2019 Aug 18
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -380,10 +380,8 @@ word before the cursor. This is available for:
|
|||||||
- Mappings: Only after a ":map" or similar command.
|
- Mappings: Only after a ":map" or similar command.
|
||||||
- Variable and function names: Only after a ":if", ":call" or similar command.
|
- Variable and function names: Only after a ":if", ":call" or similar command.
|
||||||
|
|
||||||
When Vim was compiled without the |+cmdline_compl| feature only file names,
|
The number of help item matches is limited (currently to 300) to avoid a long
|
||||||
directories and help items can be completed. The number of help item matches
|
delay when there are very many matches.
|
||||||
is limited (currently to 300) to avoid a long delay when there are very many
|
|
||||||
matches.
|
|
||||||
|
|
||||||
These are the commands that can be used:
|
These are the commands that can be used:
|
||||||
|
|
||||||
|
|||||||
@@ -817,7 +817,6 @@ ex_argdelete(exarg_T *eap)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||||
* argedit and argdelete commands.
|
* argedit and argdelete commands.
|
||||||
@@ -830,7 +829,6 @@ get_arglist_name(expand_T *xp UNUSED, int idx)
|
|||||||
|
|
||||||
return alist_name(&ARGLIST[idx]);
|
return alist_name(&ARGLIST[idx]);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the file name for an argument list entry.
|
* Get the file name for an argument list entry.
|
||||||
|
|||||||
@@ -2422,7 +2422,6 @@ has_autocmd(event_T event, char_u *sfname, buf_T *buf)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the list of autocommand group
|
* Function given to ExpandGeneric() to obtain the list of autocommand group
|
||||||
* names.
|
* names.
|
||||||
@@ -2507,7 +2506,6 @@ get_event_name(expand_T *xp UNUSED, int idx)
|
|||||||
return (char_u *)event_names[idx - augroups.ga_len].name;
|
return (char_u *)event_names[idx - augroups.ga_len].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FEAT_CMDL_COMPL
|
|
||||||
|
|
||||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -2567,8 +2567,6 @@ buflist_findpat(
|
|||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find all buffer names that match.
|
* Find all buffer names that match.
|
||||||
* For command line expansion of ":buf" and ":sbuf".
|
* For command line expansion of ":buf" and ":sbuf".
|
||||||
@@ -2673,8 +2671,6 @@ ExpandBufnames(
|
|||||||
return (count == 0 ? FAIL : OK);
|
return (count == 0 ? FAIL : OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for a match on the file name for buffer "buf" with regprog "prog".
|
* Check for a match on the file name for buffer "buf" with regprog "prog".
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,17 +18,14 @@ static int cmd_showtail; // Only show path tail in lists ?
|
|||||||
static void set_expand_context(expand_T *xp);
|
static void set_expand_context(expand_T *xp);
|
||||||
static int ExpandFromContext(expand_T *xp, char_u *, int *, char_u ***, int);
|
static int ExpandFromContext(expand_T *xp, char_u *, int *, char_u ***, int);
|
||||||
static int expand_showtail(expand_T *xp);
|
static int expand_showtail(expand_T *xp);
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
static int expand_shellcmd(char_u *filepat, int *num_file, char_u ***file, int flagsarg);
|
static int expand_shellcmd(char_u *filepat, int *num_file, char_u ***file, int flagsarg);
|
||||||
static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file, char *dirname[]);
|
static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file, char *dirname[]);
|
||||||
static int ExpandPackAddDir(char_u *pat, int *num_file, char_u ***file);
|
static int ExpandPackAddDir(char_u *pat, int *num_file, char_u ***file);
|
||||||
# if defined(FEAT_EVAL)
|
#if defined(FEAT_EVAL)
|
||||||
static int ExpandUserDefined(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file);
|
static int ExpandUserDefined(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file);
|
||||||
static int ExpandUserList(expand_T *xp, int *num_file, char_u ***file);
|
static int ExpandUserList(expand_T *xp, int *num_file, char_u ***file);
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
static int
|
static int
|
||||||
sort_func_compare(const void *s1, const void *s2)
|
sort_func_compare(const void *s1, const void *s2)
|
||||||
{
|
{
|
||||||
@@ -39,7 +36,6 @@ sort_func_compare(const void *s1, const void *s2)
|
|||||||
if (*p1 == '<' && *p2 != '<') return 1;
|
if (*p1 == '<' && *p2 != '<') return 1;
|
||||||
return STRCMP(p1, p2);
|
return STRCMP(p1, p2);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ExpandEscape(
|
ExpandEscape(
|
||||||
@@ -504,7 +500,7 @@ ExpandInit(expand_T *xp)
|
|||||||
#endif
|
#endif
|
||||||
xp->xp_numfiles = -1;
|
xp->xp_numfiles = -1;
|
||||||
xp->xp_files = NULL;
|
xp->xp_files = NULL;
|
||||||
#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
#if defined(FEAT_EVAL)
|
||||||
xp->xp_arg = NULL;
|
xp->xp_arg = NULL;
|
||||||
#endif
|
#endif
|
||||||
xp->xp_line = NULL;
|
xp->xp_line = NULL;
|
||||||
@@ -985,18 +981,14 @@ set_cmd_context(
|
|||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
if (use_ccline && ccline->cmdfirstc == '=')
|
if (use_ccline && ccline->cmdfirstc == '=')
|
||||||
{
|
{
|
||||||
# ifdef FEAT_CMDL_COMPL
|
|
||||||
// pass CMD_SIZE because there is no real command
|
// pass CMD_SIZE because there is no real command
|
||||||
set_context_for_expression(xp, str, CMD_SIZE);
|
set_context_for_expression(xp, str, CMD_SIZE);
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
else if (use_ccline && ccline->input_fn)
|
else if (use_ccline && ccline->input_fn)
|
||||||
{
|
{
|
||||||
xp->xp_context = ccline->xp_context;
|
xp->xp_context = ccline->xp_context;
|
||||||
xp->xp_pattern = ccline->cmdbuff;
|
xp->xp_pattern = ccline->cmdbuff;
|
||||||
# if defined(FEAT_CMDL_COMPL)
|
|
||||||
xp->xp_arg = ccline->xp_arg;
|
xp->xp_arg = ccline->xp_arg;
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@@ -1131,9 +1123,7 @@ ExpandFromContext(
|
|||||||
char_u ***file,
|
char_u ***file,
|
||||||
int options) // WILD_ flags
|
int options) // WILD_ flags
|
||||||
{
|
{
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
regmatch_T regmatch;
|
regmatch_T regmatch;
|
||||||
#endif
|
|
||||||
int ret;
|
int ret;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
@@ -1230,9 +1220,6 @@ ExpandFromContext(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FEAT_CMDL_COMPL
|
|
||||||
return FAIL;
|
|
||||||
#else
|
|
||||||
if (xp->xp_context == EXPAND_SHELLCMD)
|
if (xp->xp_context == EXPAND_SHELLCMD)
|
||||||
return expand_shellcmd(pat, num_file, file, flags);
|
return expand_shellcmd(pat, num_file, file, flags);
|
||||||
if (xp->xp_context == EXPAND_OLD_SETTING)
|
if (xp->xp_context == EXPAND_OLD_SETTING)
|
||||||
@@ -1361,10 +1348,8 @@ ExpandFromContext(
|
|||||||
vim_regfree(regmatch.regprog);
|
vim_regfree(regmatch.regprog);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
#endif // FEAT_CMDL_COMPL
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Expand a list of names.
|
* Expand a list of names.
|
||||||
*
|
*
|
||||||
@@ -1452,11 +1437,11 @@ ExpandGeneric(
|
|||||||
sort_strings(*file, *num_file);
|
sort_strings(*file, *num_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef FEAT_CMDL_COMPL
|
#if defined(FEAT_SYN_HL)
|
||||||
// Reset the variables used for special highlight names expansion, so that
|
// Reset the variables used for special highlight names expansion, so that
|
||||||
// they don't show up when getting normal highlight names by ID.
|
// they don't show up when getting normal highlight names by ID.
|
||||||
reset_expand_highlight();
|
reset_expand_highlight();
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -1890,9 +1875,7 @@ ExpandPackAddDir(
|
|||||||
*num_file = ga.ga_len;
|
*num_file = ga.ga_len;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(FEAT_EVAL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Expand "file" for all comma-separated directories in "path".
|
* Expand "file" for all comma-separated directories in "path".
|
||||||
* Adds the matches to "ga". Caller must init "ga".
|
* Adds the matches to "ga". Caller must init "ga".
|
||||||
@@ -1955,9 +1938,8 @@ globpath(
|
|||||||
|
|
||||||
vim_free(buf);
|
vim_free(buf);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) | defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
* "getcompletion()" function
|
* "getcompletion()" function
|
||||||
*/
|
*/
|
||||||
@@ -2028,4 +2010,4 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
|
|||||||
vim_free(pat);
|
vim_free(pat);
|
||||||
ExpandCleanup(&xpc);
|
ExpandCleanup(&xpc);
|
||||||
}
|
}
|
||||||
#endif // FEAT_CMDL_COMPL
|
#endif // FEAT_EVAL
|
||||||
|
|||||||
@@ -88,7 +88,6 @@ static char *(history_names[]) =
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the possible first
|
* Function given to ExpandGeneric() to obtain the possible first
|
||||||
* arguments of the ":history command.
|
* arguments of the ":history command.
|
||||||
@@ -112,7 +111,6 @@ get_history_arg(expand_T *xp UNUSED, int idx)
|
|||||||
return (char_u *)"all";
|
return (char_u *)"all";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* init_history() - Initialize the command line history.
|
* init_history() - Initialize the command line history.
|
||||||
|
|||||||
16
src/eval.c
16
src/eval.c
@@ -420,9 +420,7 @@ eval_clear(void)
|
|||||||
hash_clear(&compat_hashtab);
|
hash_clear(&compat_hashtab);
|
||||||
|
|
||||||
free_scriptnames();
|
free_scriptnames();
|
||||||
# if defined(FEAT_CMDL_COMPL)
|
|
||||||
free_locales();
|
free_locales();
|
||||||
# endif
|
|
||||||
|
|
||||||
/* global variables */
|
/* global variables */
|
||||||
vars_clear(&globvarht);
|
vars_clear(&globvarht);
|
||||||
@@ -1135,10 +1133,6 @@ call_func_retnr(
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) \
|
|
||||||
|| defined(FEAT_COMPL_FUNC) || defined(PROTO)
|
|
||||||
|
|
||||||
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Call Vim script function "func" and return the result as a string.
|
* Call Vim script function "func" and return the result as a string.
|
||||||
* Returns NULL when calling the function fails.
|
* Returns NULL when calling the function fails.
|
||||||
@@ -1161,7 +1155,6 @@ call_func_retstr(
|
|||||||
clear_tv(&rettv);
|
clear_tv(&rettv);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call Vim script function "func" and return the result as a List.
|
* Call Vim script function "func" and return the result as a List.
|
||||||
@@ -1188,7 +1181,6 @@ call_func_retlist(
|
|||||||
|
|
||||||
return rettv.vval.v_list;
|
return rettv.vval.v_list;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef FEAT_FOLDING
|
#ifdef FEAT_FOLDING
|
||||||
@@ -2994,8 +2986,6 @@ free_for_info(void *fi_void)
|
|||||||
vim_free(fi);
|
vim_free(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
void
|
void
|
||||||
set_context_for_expression(
|
set_context_for_expression(
|
||||||
expand_T *xp,
|
expand_T *xp,
|
||||||
@@ -3110,8 +3100,6 @@ set_context_for_expression(
|
|||||||
xp->xp_pattern = arg;
|
xp->xp_pattern = arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ":unlet[!] var1 ... " command.
|
* ":unlet[!] var1 ... " command.
|
||||||
*/
|
*/
|
||||||
@@ -3509,8 +3497,6 @@ del_menutrans_vars(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local string buffer for the next two functions to store a variable name
|
* Local string buffer for the next two functions to store a variable name
|
||||||
* with its prefix. Allocated in cat_prefix_varname(), freed later in
|
* with its prefix. Allocated in cat_prefix_varname(), freed later in
|
||||||
@@ -3630,8 +3616,6 @@ get_user_var_name(expand_T *xp, int idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if "pat" matches "text".
|
* Return TRUE if "pat" matches "text".
|
||||||
* Does not use 'cpo' and always uses 'magic'.
|
* Does not use 'cpo' and always uses 'magic'.
|
||||||
|
|||||||
@@ -573,9 +573,7 @@ static funcentry_T global_functions[] =
|
|||||||
{"getcmdpos", 0, 0, 0, f_getcmdpos},
|
{"getcmdpos", 0, 0, 0, f_getcmdpos},
|
||||||
{"getcmdtype", 0, 0, 0, f_getcmdtype},
|
{"getcmdtype", 0, 0, 0, f_getcmdtype},
|
||||||
{"getcmdwintype", 0, 0, 0, f_getcmdwintype},
|
{"getcmdwintype", 0, 0, 0, f_getcmdwintype},
|
||||||
#if defined(FEAT_CMDL_COMPL)
|
|
||||||
{"getcompletion", 2, 3, 0, f_getcompletion},
|
{"getcompletion", 2, 3, 0, f_getcompletion},
|
||||||
#endif
|
|
||||||
{"getcurpos", 0, 0, 0, f_getcurpos},
|
{"getcurpos", 0, 0, 0, f_getcurpos},
|
||||||
{"getcwd", 0, 2, 0, f_getcwd},
|
{"getcwd", 0, 2, 0, f_getcwd},
|
||||||
{"getenv", 1, 1, 0, f_getenv},
|
{"getenv", 1, 1, 0, f_getenv},
|
||||||
@@ -981,8 +979,6 @@ static funcentry_T global_functions[] =
|
|||||||
{"xor", 2, 2, 0, f_xor},
|
{"xor", 2, 2, 0, f_xor},
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the list of internal
|
* Function given to ExpandGeneric() to obtain the list of internal
|
||||||
* or user defined function names.
|
* or user defined function names.
|
||||||
@@ -1034,8 +1030,6 @@ get_expr_name(expand_T *xp, int idx)
|
|||||||
return get_user_var_name(xp, ++intidx);
|
return get_user_var_name(xp, ++intidx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find internal function "name" in table "global_functions".
|
* Find internal function "name" in table "global_functions".
|
||||||
* Return index, or -1 if not found
|
* Return index, or -1 if not found
|
||||||
@@ -5845,9 +5839,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
#ifdef FEAT_CLIPBOARD
|
#ifdef FEAT_CLIPBOARD
|
||||||
"clipboard",
|
"clipboard",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
"cmdline_compl",
|
"cmdline_compl",
|
||||||
#endif
|
|
||||||
"cmdline_hist",
|
"cmdline_hist",
|
||||||
#ifdef FEAT_COMMENTS
|
#ifdef FEAT_COMMENTS
|
||||||
"comments",
|
"comments",
|
||||||
|
|||||||
@@ -3242,15 +3242,15 @@ ex_language(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
static char_u **locales = NULL; /* Array of all available locales */
|
static char_u **locales = NULL; /* Array of all available locales */
|
||||||
|
|
||||||
# ifndef MSWIN
|
# ifndef MSWIN
|
||||||
static int did_init_locales = FALSE;
|
static int did_init_locales = FALSE;
|
||||||
|
|
||||||
/* Return an array of strings for all available locales + NULL for the
|
/*
|
||||||
* last element. Return NULL in case of error. */
|
* Return an array of strings for all available locales + NULL for the
|
||||||
|
* last element. Return NULL in case of error.
|
||||||
|
*/
|
||||||
static char_u **
|
static char_u **
|
||||||
find_locales(void)
|
find_locales(void)
|
||||||
{
|
{
|
||||||
@@ -3289,7 +3289,7 @@ find_locales(void)
|
|||||||
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
|
((char_u **)locales_ga.ga_data)[locales_ga.ga_len] = NULL;
|
||||||
return (char_u **)locales_ga.ga_data;
|
return (char_u **)locales_ga.ga_data;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lazy initialization of all available locales.
|
* Lazy initialization of all available locales.
|
||||||
@@ -3351,6 +3351,5 @@ get_locales(expand_T *xp UNUSED, int idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
return locales[idx];
|
return locales[idx];
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3323,10 +3323,8 @@ set_one_cmd_context(
|
|||||||
char_u *cmd, *arg;
|
char_u *cmd, *arg;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
exarg_T ea;
|
exarg_T ea;
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
int compl = EXPAND_NOTHING;
|
int compl = EXPAND_NOTHING;
|
||||||
int delim;
|
int delim;
|
||||||
#endif
|
|
||||||
int forceit = FALSE;
|
int forceit = FALSE;
|
||||||
int usefilter = FALSE; /* filter instead of file name */
|
int usefilter = FALSE; /* filter instead of file name */
|
||||||
|
|
||||||
@@ -3432,13 +3430,7 @@ set_one_cmd_context(
|
|||||||
else if (cmd[0] >= 'A' && cmd[0] <= 'Z')
|
else if (cmd[0] >= 'A' && cmd[0] <= 'Z')
|
||||||
{
|
{
|
||||||
ea.cmd = cmd;
|
ea.cmd = cmd;
|
||||||
p = find_ucmd(&ea, p, NULL, xp,
|
p = find_ucmd(&ea, p, NULL, xp, &compl);
|
||||||
#if defined(FEAT_CMDL_COMPL)
|
|
||||||
&compl
|
|
||||||
#else
|
|
||||||
NULL
|
|
||||||
#endif
|
|
||||||
);
|
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
ea.cmdidx = CMD_SIZE; // ambiguous user command
|
ea.cmdidx = CMD_SIZE; // ambiguous user command
|
||||||
}
|
}
|
||||||
@@ -3662,14 +3654,11 @@ set_one_cmd_context(
|
|||||||
{
|
{
|
||||||
xp->xp_context = EXPAND_ENV_VARS;
|
xp->xp_context = EXPAND_ENV_VARS;
|
||||||
++xp->xp_pattern;
|
++xp->xp_pattern;
|
||||||
#if defined(FEAT_CMDL_COMPL)
|
|
||||||
/* Avoid that the assignment uses EXPAND_FILES again. */
|
/* Avoid that the assignment uses EXPAND_FILES again. */
|
||||||
if (compl != EXPAND_USER_DEFINED && compl != EXPAND_USER_LIST)
|
if (compl != EXPAND_USER_DEFINED && compl != EXPAND_USER_LIST)
|
||||||
compl = EXPAND_ENV_VARS;
|
compl = EXPAND_ENV_VARS;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(FEAT_CMDL_COMPL)
|
|
||||||
/* Check for user names */
|
/* Check for user names */
|
||||||
if (*xp->xp_pattern == '~')
|
if (*xp->xp_pattern == '~')
|
||||||
{
|
{
|
||||||
@@ -3685,7 +3674,6 @@ set_one_cmd_context(
|
|||||||
++xp->xp_pattern;
|
++xp->xp_pattern;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3759,8 +3747,7 @@ set_one_cmd_context(
|
|||||||
}
|
}
|
||||||
return skipwhite(arg);
|
return skipwhite(arg);
|
||||||
|
|
||||||
#ifdef FEAT_CMDL_COMPL
|
#ifdef FEAT_SEARCH_EXTRA
|
||||||
# ifdef FEAT_SEARCH_EXTRA
|
|
||||||
case CMD_match:
|
case CMD_match:
|
||||||
if (*arg == NUL || !ends_excmd(*arg))
|
if (*arg == NUL || !ends_excmd(*arg))
|
||||||
{
|
{
|
||||||
@@ -3774,7 +3761,7 @@ set_one_cmd_context(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return find_nextcmd(arg);
|
return find_nextcmd(arg);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* All completion for the +cmdline_compl feature goes here.
|
* All completion for the +cmdline_compl feature goes here.
|
||||||
@@ -4143,8 +4130,6 @@ set_one_cmd_context(
|
|||||||
xp->xp_pattern = arg;
|
xp->xp_pattern = arg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -5554,7 +5539,6 @@ check_more(
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the list of command names.
|
* Function given to ExpandGeneric() to obtain the list of command names.
|
||||||
*/
|
*/
|
||||||
@@ -5565,7 +5549,6 @@ get_command_name(expand_T *xp UNUSED, int idx)
|
|||||||
return get_user_command_name(idx);
|
return get_user_command_name(idx);
|
||||||
return cmdnames[idx].cmd_name;
|
return cmdnames[idx].cmd_name;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ex_colorscheme(exarg_T *eap)
|
ex_colorscheme(exarg_T *eap)
|
||||||
@@ -9178,7 +9161,6 @@ ex_behave(exarg_T *eap)
|
|||||||
semsg(_(e_invarg2), eap->arg);
|
semsg(_(e_invarg2), eap->arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||||
* ":behave {mswin,xterm}" command.
|
* ":behave {mswin,xterm}" command.
|
||||||
@@ -9204,9 +9186,7 @@ get_messages_arg(expand_T *xp UNUSED, int idx)
|
|||||||
return (char_u *)"clear";
|
return (char_u *)"clear";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
char_u *
|
char_u *
|
||||||
get_mapclear_arg(expand_T *xp UNUSED, int idx)
|
get_mapclear_arg(expand_T *xp UNUSED, int idx)
|
||||||
{
|
{
|
||||||
@@ -9214,7 +9194,6 @@ get_mapclear_arg(expand_T *xp UNUSED, int idx)
|
|||||||
return (char_u *)"<buffer>";
|
return (char_u *)"<buffer>";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int filetype_detect = FALSE;
|
static int filetype_detect = FALSE;
|
||||||
static int filetype_plugin = FALSE;
|
static int filetype_plugin = FALSE;
|
||||||
|
|||||||
@@ -894,9 +894,7 @@ getcmdline_int(
|
|||||||
{
|
{
|
||||||
xpc.xp_context = ccline.xp_context;
|
xpc.xp_context = ccline.xp_context;
|
||||||
xpc.xp_pattern = ccline.cmdbuff;
|
xpc.xp_pattern = ccline.cmdbuff;
|
||||||
# if defined(FEAT_CMDL_COMPL)
|
|
||||||
xpc.xp_arg = ccline.xp_arg;
|
xpc.xp_arg = ccline.xp_arg;
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,7 @@
|
|||||||
* +virtualedit 'virtualedit' option and its implementation
|
* +virtualedit 'virtualedit' option and its implementation
|
||||||
* +user_commands Allow the user to define his own commands.
|
* +user_commands Allow the user to define his own commands.
|
||||||
* +multi_byte Generic multi-byte character handling.
|
* +multi_byte Generic multi-byte character handling.
|
||||||
|
* +cmdline_compl completion of mappings/abbreviations in cmdline mode.
|
||||||
*
|
*
|
||||||
* Obsolete:
|
* Obsolete:
|
||||||
* +tag_old_static Old style static tags: "file:tag file ..".
|
* +tag_old_static Old style static tags: "file:tag file ..".
|
||||||
@@ -177,14 +178,6 @@
|
|||||||
# define FEAT_INS_EXPAND
|
# define FEAT_INS_EXPAND
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* +cmdline_compl completion of mappings/abbreviations in cmdline mode.
|
|
||||||
* Takes a few Kbyte of code.
|
|
||||||
*/
|
|
||||||
#ifdef FEAT_NORMAL
|
|
||||||
# define FEAT_CMDL_COMPL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_NORMAL
|
#ifdef FEAT_NORMAL
|
||||||
# define VIM_BACKTICK /* internal backtick expansion */
|
# define VIM_BACKTICK /* internal backtick expansion */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -356,12 +356,10 @@ EXTERN char_u hash_removed;
|
|||||||
EXTERN int scroll_region INIT(= FALSE); // term supports scroll region
|
EXTERN int scroll_region INIT(= FALSE); // term supports scroll region
|
||||||
EXTERN int t_colors INIT(= 0); // int value of T_CCO
|
EXTERN int t_colors INIT(= 0); // int value of T_CCO
|
||||||
|
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
// Flags to indicate an additional string for highlight name completion.
|
// Flags to indicate an additional string for highlight name completion.
|
||||||
EXTERN int include_none INIT(= 0); // when 1 include "None"
|
EXTERN int include_none INIT(= 0); // when 1 include "None"
|
||||||
EXTERN int include_default INIT(= 0); // when 1 include "default"
|
EXTERN int include_default INIT(= 0); // when 1 include "default"
|
||||||
EXTERN int include_link INIT(= 0); // when 2 include "link" and "clear"
|
EXTERN int include_link INIT(= 0); // when 2 include "link" and "clear"
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When highlight_match is TRUE, highlight a match, starting at the cursor
|
* When highlight_match is TRUE, highlight a match, starting at the cursor
|
||||||
|
|||||||
@@ -3499,8 +3499,6 @@ highlight_changed(void)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
static void highlight_list(void);
|
static void highlight_list(void);
|
||||||
static void highlight_list_two(int cnt, int attr);
|
static void highlight_list_two(int cnt, int attr);
|
||||||
|
|
||||||
@@ -3577,10 +3575,6 @@ highlight_list_two(int cnt, int attr)
|
|||||||
ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE);
|
ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FEAT_CMDL_COMPL
|
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_SYN_HL) && defined(FEAT_EVAL)) \
|
|
||||||
|| defined(FEAT_SIGNS) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the list of group names.
|
* Function given to ExpandGeneric() to obtain the list of group names.
|
||||||
*/
|
*/
|
||||||
@@ -3605,7 +3599,6 @@ get_highlight_name_ext(expand_T *xp UNUSED, int idx, int skip_cleared)
|
|||||||
if (skip_cleared && idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
if (skip_cleared && idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
||||||
return (char_u *)"";
|
return (char_u *)"";
|
||||||
|
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
if (idx == highlight_ga.ga_len && include_none != 0)
|
if (idx == highlight_ga.ga_len && include_none != 0)
|
||||||
return (char_u *)"none";
|
return (char_u *)"none";
|
||||||
if (idx == highlight_ga.ga_len + include_none && include_default != 0)
|
if (idx == highlight_ga.ga_len + include_none && include_default != 0)
|
||||||
@@ -3616,12 +3609,10 @@ get_highlight_name_ext(expand_T *xp UNUSED, int idx, int skip_cleared)
|
|||||||
if (idx == highlight_ga.ga_len + include_none + include_default + 1
|
if (idx == highlight_ga.ga_len + include_none + include_default + 1
|
||||||
&& include_link != 0)
|
&& include_link != 0)
|
||||||
return (char_u *)"clear";
|
return (char_u *)"clear";
|
||||||
#endif
|
|
||||||
if (idx >= highlight_ga.ga_len)
|
if (idx >= highlight_ga.ga_len)
|
||||||
return NULL;
|
return NULL;
|
||||||
return HL_TABLE()[idx].sg_name;
|
return HL_TABLE()[idx].sg_name;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_GUI) || defined(PROTO)
|
#if defined(FEAT_GUI) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ cs_usage_msg(csid_e x)
|
|||||||
(void)semsg(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
|
(void)semsg(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
static enum
|
static enum
|
||||||
{
|
{
|
||||||
EXP_CSCOPE_SUBCMD, /* expand ":cscope" sub-commands */
|
EXP_CSCOPE_SUBCMD, /* expand ":cscope" sub-commands */
|
||||||
@@ -189,8 +187,6 @@ set_context_in_cscope_cmd(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the command, print help if invalid, and then call the corresponding
|
* Find the command, print help if invalid, and then call the corresponding
|
||||||
* command function.
|
* command function.
|
||||||
|
|||||||
@@ -982,7 +982,6 @@ map_to_exists_mode(char_u *rhs, int mode, int abbr)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Used below when expanding mapping/abbreviation names.
|
* Used below when expanding mapping/abbreviation names.
|
||||||
*/
|
*/
|
||||||
@@ -1198,7 +1197,6 @@ ExpandMappings(
|
|||||||
*num_file = count;
|
*num_file = count;
|
||||||
return (count == 0 ? FAIL : OK);
|
return (count == 0 ? FAIL : OK);
|
||||||
}
|
}
|
||||||
#endif // FEAT_CMDL_COMPL
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for an abbreviation.
|
* Check for an abbreviation.
|
||||||
|
|||||||
@@ -43,9 +43,7 @@ static int s_tearoffs = FALSE;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int menu_is_hidden(char_u *name);
|
static int menu_is_hidden(char_u *name);
|
||||||
#if defined(FEAT_CMDL_COMPL) || (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF))
|
|
||||||
static int menu_is_tearoff(char_u *name);
|
static int menu_is_tearoff(char_u *name);
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_MULTI_LANG) || defined(FEAT_TOOLBAR)
|
#if defined(FEAT_MULTI_LANG) || defined(FEAT_TOOLBAR)
|
||||||
static char_u *menu_skip_part(char_u *p);
|
static char_u *menu_skip_part(char_u *p);
|
||||||
@@ -1234,8 +1232,6 @@ show_menus_recursive(vimmenu_T *menu, int modes, int depth)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used when expanding menu names.
|
* Used when expanding menu names.
|
||||||
*/
|
*/
|
||||||
@@ -1555,7 +1551,6 @@ get_menu_names(expand_T *xp UNUSED, int idx)
|
|||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip over this element of the menu path and return the start of the next
|
* Skip over this element of the menu path and return the start of the next
|
||||||
@@ -1864,8 +1859,6 @@ menu_is_hidden(char_u *name)
|
|||||||
return (name[0] == ']') || (menu_is_popup(name) && name[5] != NUL);
|
return (name[0] == ']') || (menu_is_popup(name) && name[5] != NUL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) \
|
|
||||||
|| (defined(FEAT_GUI_MSWIN) && defined(FEAT_TEAROFF))
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if the menu is the tearoff menu.
|
* Return TRUE if the menu is the tearoff menu.
|
||||||
*/
|
*/
|
||||||
@@ -1878,7 +1871,6 @@ menu_is_tearoff(char_u *name UNUSED)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_GUI) || defined(FEAT_TERM_POPUP_MENU) || defined(PROTO)
|
#if defined(FEAT_GUI) || defined(FEAT_TERM_POPUP_MENU) || defined(PROTO)
|
||||||
|
|
||||||
|
|||||||
16
src/misc1.c
16
src/misc1.c
@@ -14,7 +14,7 @@
|
|||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) && defined(MSWIN)
|
#if defined(MSWIN)
|
||||||
# include <lm.h>
|
# include <lm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -24,10 +24,8 @@ static char_u *remove_tail(char_u *p, char_u *pend, char_u *name);
|
|||||||
#define URL_SLASH 1 /* path_is_url() has found "://" */
|
#define URL_SLASH 1 /* path_is_url() has found "://" */
|
||||||
#define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */
|
#define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */
|
||||||
|
|
||||||
/* All user names (for ~user completion as done by shell). */
|
// All user names (for ~user completion as done by shell).
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
static garray_T ga_users;
|
static garray_T ga_users;
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Count the size (in window cells) of the indent in the current line.
|
* Count the size (in window cells) of the indent in the current line.
|
||||||
@@ -1715,13 +1713,11 @@ free_homedir(void)
|
|||||||
vim_free(homedir);
|
vim_free(homedir);
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef FEAT_CMDL_COMPL
|
|
||||||
void
|
void
|
||||||
free_users(void)
|
free_users(void)
|
||||||
{
|
{
|
||||||
ga_clear_strings(&ga_users);
|
ga_clear_strings(&ga_users);
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2366,7 +2362,6 @@ vim_setenv(char_u *name, char_u *val)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain an environment variable name.
|
* Function given to ExpandGeneric() to obtain an environment variable name.
|
||||||
*/
|
*/
|
||||||
@@ -2532,7 +2527,6 @@ match_user(char_u *name)
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace home directory by "~" in each space or comma separated file name in
|
* Replace home directory by "~" in each space or comma separated file name in
|
||||||
@@ -3868,7 +3862,6 @@ unix_expandpath(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_SEARCHPATH) || defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Sort "gap" and remove duplicate entries. "gap" is expected to contain a
|
* Sort "gap" and remove duplicate entries. "gap" is expected to contain a
|
||||||
* list of file names in allocated memory.
|
* list of file names in allocated memory.
|
||||||
@@ -3890,7 +3883,6 @@ remove_duplicates(garray_T *gap)
|
|||||||
--gap->ga_len;
|
--gap->ga_len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TRUE if "p" contains what looks like an environment variable.
|
* Return TRUE if "p" contains what looks like an environment variable.
|
||||||
@@ -4246,7 +4238,9 @@ addfile(
|
|||||||
}
|
}
|
||||||
#endif /* !NO_EXPANDPATH */
|
#endif /* !NO_EXPANDPATH */
|
||||||
|
|
||||||
#if defined(VIM_BACKTICK) || defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(VIM_BACKTICK) || defined(FEAT_EVAL) \
|
||||||
|
|| (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
|
||||||
|
|| defined(PROTO)
|
||||||
|
|
||||||
#ifndef SEEK_SET
|
#ifndef SEEK_SET
|
||||||
# define SEEK_SET 0
|
# define SEEK_SET 0
|
||||||
|
|||||||
@@ -1108,9 +1108,7 @@ free_all_mem(void)
|
|||||||
free_all_marks();
|
free_all_marks();
|
||||||
alist_clear(&global_alist);
|
alist_clear(&global_alist);
|
||||||
free_homedir();
|
free_homedir();
|
||||||
# if defined(FEAT_CMDL_COMPL)
|
|
||||||
free_users();
|
free_users();
|
||||||
# endif
|
|
||||||
free_search_patterns();
|
free_search_patterns();
|
||||||
free_old_sub();
|
free_old_sub();
|
||||||
free_last_insert();
|
free_last_insert();
|
||||||
@@ -3041,7 +3039,6 @@ get_special_key_code(char_u *name)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
char_u *
|
char_u *
|
||||||
get_key_name(int i)
|
get_key_name(int i)
|
||||||
{
|
{
|
||||||
@@ -3049,7 +3046,6 @@ get_key_name(int i)
|
|||||||
return NULL;
|
return NULL;
|
||||||
return key_names_table[i].name;
|
return key_names_table[i].name;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_MOUSE) || defined(PROTO)
|
#if defined(FEAT_MOUSE) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
|
|||||||
11
src/option.c
11
src/option.c
@@ -3045,13 +3045,8 @@ static struct vimoption options[] =
|
|||||||
(char_u *)&p_wim, PV_NONE,
|
(char_u *)&p_wim, PV_NONE,
|
||||||
{(char_u *)"full", (char_u *)0L} SCTX_INIT},
|
{(char_u *)"full", (char_u *)0L} SCTX_INIT},
|
||||||
{"wildoptions", "wop", P_STRING|P_VI_DEF,
|
{"wildoptions", "wop", P_STRING|P_VI_DEF,
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
(char_u *)&p_wop, PV_NONE,
|
(char_u *)&p_wop, PV_NONE,
|
||||||
{(char_u *)"", (char_u *)0L}
|
{(char_u *)"", (char_u *)0L}
|
||||||
#else
|
|
||||||
(char_u *)NULL, PV_NONE,
|
|
||||||
{(char_u *)NULL, (char_u *)0L}
|
|
||||||
#endif
|
|
||||||
SCTX_INIT},
|
SCTX_INIT},
|
||||||
{"winaltkeys", "wak", P_STRING|P_VI_DEF,
|
{"winaltkeys", "wak", P_STRING|P_VI_DEF,
|
||||||
#ifdef FEAT_WAK
|
#ifdef FEAT_WAK
|
||||||
@@ -3228,9 +3223,7 @@ static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL};
|
|||||||
#ifdef FEAT_CRYPT
|
#ifdef FEAT_CRYPT
|
||||||
static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", NULL};
|
static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", NULL};
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
static char *(p_wop_values[]) = {"tagfile", NULL};
|
static char *(p_wop_values[]) = {"tagfile", NULL};
|
||||||
#endif
|
|
||||||
#ifdef FEAT_WAK
|
#ifdef FEAT_WAK
|
||||||
static char *(p_wak_values[]) = {"yes", "menu", "no", NULL};
|
static char *(p_wak_values[]) = {"yes", "menu", "no", NULL};
|
||||||
#endif
|
#endif
|
||||||
@@ -6510,14 +6503,12 @@ did_set_string_option(
|
|||||||
errmsg = e_invarg;
|
errmsg = e_invarg;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
/* 'wildoptions' */
|
/* 'wildoptions' */
|
||||||
else if (varp == &p_wop)
|
else if (varp == &p_wop)
|
||||||
{
|
{
|
||||||
if (check_opt_strings(p_wop, p_wop_values, TRUE) != OK)
|
if (check_opt_strings(p_wop, p_wop_values, TRUE) != OK)
|
||||||
errmsg = e_invarg;
|
errmsg = e_invarg;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef FEAT_WAK
|
#ifdef FEAT_WAK
|
||||||
/* 'winaltkeys' */
|
/* 'winaltkeys' */
|
||||||
@@ -11846,7 +11837,6 @@ set_imsearch_global(void)
|
|||||||
p_imsearch = curbuf->b_p_imsearch;
|
p_imsearch = curbuf->b_p_imsearch;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
static int expand_option_idx = -1;
|
static int expand_option_idx = -1;
|
||||||
static char_u expand_option_name[5] = {'t', '_', NUL, NUL, NUL};
|
static char_u expand_option_name[5] = {'t', '_', NUL, NUL, NUL};
|
||||||
static int expand_option_flags = 0;
|
static int expand_option_flags = 0;
|
||||||
@@ -12276,7 +12266,6 @@ ExpandOldSetting(int *num_file, char_u ***file)
|
|||||||
*num_file = 1;
|
*num_file = 1;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the value for the numeric or string option *opp in a nice format into
|
* Get the value for the numeric or string option *opp in a nice format into
|
||||||
|
|||||||
@@ -926,9 +926,7 @@ char_u *p_vfile = (char_u *)""; // used before options are initialized
|
|||||||
extern char_u *p_vfile; // 'verbosefile'
|
extern char_u *p_vfile; // 'verbosefile'
|
||||||
#endif
|
#endif
|
||||||
EXTERN int p_warn; // 'warn'
|
EXTERN int p_warn; // 'warn'
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
EXTERN char_u *p_wop; // 'wildoptions'
|
EXTERN char_u *p_wop; // 'wildoptions'
|
||||||
#endif
|
|
||||||
EXTERN long p_window; // 'window'
|
EXTERN long p_window; // 'window'
|
||||||
#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \
|
#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \
|
||||||
|| defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
|
|| defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON)
|
||||||
|
|||||||
@@ -1878,7 +1878,6 @@ free_signs(void)
|
|||||||
sign_undefine(first_sign, NULL);
|
sign_undefine(first_sign, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
static enum
|
static enum
|
||||||
{
|
{
|
||||||
EXP_SUBCMD, // expand :sign sub-commands
|
EXP_SUBCMD, // expand :sign sub-commands
|
||||||
@@ -2107,7 +2106,6 @@ set_context_in_sign_cmd(expand_T *xp, char_u *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define a sign using the attributes in 'dict'. Returns 0 on success and -1 on
|
* Define a sign using the attributes in 'dict'. Returns 0 on success and -1 on
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ typedef struct expand
|
|||||||
int xp_context; // type of expansion
|
int xp_context; // type of expansion
|
||||||
char_u *xp_pattern; // start of item to expand
|
char_u *xp_pattern; // start of item to expand
|
||||||
int xp_pattern_len; // bytes in xp_pattern before cursor
|
int xp_pattern_len; // bytes in xp_pattern before cursor
|
||||||
#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
#if defined(FEAT_EVAL)
|
||||||
char_u *xp_arg; // completion function
|
char_u *xp_arg; // completion function
|
||||||
sctx_T xp_script_ctx; // SCTX for completion function
|
sctx_T xp_script_ctx; // SCTX for completion function
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6302,7 +6302,6 @@ syntax_present(win_T *win)
|
|||||||
|| win->w_s->b_keywtab_ic.ht_used > 0);
|
|| win->w_s->b_keywtab_ic.ht_used > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
static enum
|
static enum
|
||||||
{
|
{
|
||||||
@@ -6409,7 +6408,6 @@ get_syntax_name(expand_T *xp UNUSED, int idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function called for expression evaluation: get syntax ID at file position.
|
* Function called for expression evaluation: get syntax ID at file position.
|
||||||
@@ -6569,7 +6567,6 @@ syntime_clear(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||||
* ":syntime {on,off,clear,report}" command.
|
* ":syntime {on,off,clear,report}" command.
|
||||||
@@ -6586,7 +6583,6 @@ get_syntime_arg(expand_T *xp UNUSED, int idx)
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3859,7 +3859,6 @@ tagstack_clear_entry(taggy_T *item)
|
|||||||
VIM_CLEAR(item->user_data);
|
VIM_CLEAR(item->user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
int
|
int
|
||||||
expand_tags(
|
expand_tags(
|
||||||
int tagnames, /* expand tag names */
|
int tagnames, /* expand tag names */
|
||||||
@@ -3907,7 +3906,6 @@ expand_tags(
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -4299,7 +4299,6 @@ find_termcode(char_u *name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
char_u *
|
char_u *
|
||||||
get_termcode(int i)
|
get_termcode(int i)
|
||||||
{
|
{
|
||||||
@@ -4307,7 +4306,6 @@ get_termcode(int i)
|
|||||||
return NULL;
|
return NULL;
|
||||||
return &termcodes[i].name[0];
|
return &termcodes[i].name[0];
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
del_termcode(char_u *name)
|
del_termcode(char_u *name)
|
||||||
@@ -6700,7 +6698,6 @@ check_for_codes_from_term(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
/*
|
/*
|
||||||
* Translate an internal mapping/abbreviation representation into the
|
* Translate an internal mapping/abbreviation representation into the
|
||||||
* corresponding external one recognized by :map/:abbrev commands.
|
* corresponding external one recognized by :map/:abbrev commands.
|
||||||
@@ -6775,7 +6772,6 @@ translate_mapping(char_u *str)
|
|||||||
ga_append(&ga, NUL);
|
ga_append(&ga, NUL);
|
||||||
return (char_u *)(ga.ga_data);
|
return (char_u *)(ga.ga_data);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined(MSWIN) && (!defined(FEAT_GUI) || defined(VIMDLL))) || defined(PROTO)
|
#if (defined(MSWIN) && (!defined(FEAT_GUI) || defined(VIMDLL))) || defined(PROTO)
|
||||||
static char ksme_str[20];
|
static char ksme_str[20];
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ typedef struct ucmd
|
|||||||
cmd_addr_T uc_addr_type; // The command's address type
|
cmd_addr_T uc_addr_type; // The command's address type
|
||||||
# ifdef FEAT_EVAL
|
# ifdef FEAT_EVAL
|
||||||
sctx_T uc_script_ctx; // SCTX where the command was defined
|
sctx_T uc_script_ctx; // SCTX 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;
|
||||||
|
|
||||||
@@ -55,7 +53,7 @@ static struct
|
|||||||
#if defined(FEAT_CSCOPE)
|
#if defined(FEAT_CSCOPE)
|
||||||
{EXPAND_CSCOPE, "cscope"},
|
{EXPAND_CSCOPE, "cscope"},
|
||||||
#endif
|
#endif
|
||||||
#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
#if defined(FEAT_EVAL)
|
||||||
{EXPAND_USER_DEFINED, "custom"},
|
{EXPAND_USER_DEFINED, "custom"},
|
||||||
{EXPAND_USER_LIST, "customlist"},
|
{EXPAND_USER_LIST, "customlist"},
|
||||||
#endif
|
#endif
|
||||||
@@ -185,17 +183,15 @@ find_ucmd(
|
|||||||
eap->useridx = j;
|
eap->useridx = j;
|
||||||
eap->addr_type = uc->uc_addr_type;
|
eap->addr_type = uc->uc_addr_type;
|
||||||
|
|
||||||
# ifdef FEAT_CMDL_COMPL
|
|
||||||
if (complp != NULL)
|
if (complp != NULL)
|
||||||
*complp = uc->uc_compl;
|
*complp = uc->uc_compl;
|
||||||
# ifdef FEAT_EVAL
|
# ifdef FEAT_EVAL
|
||||||
if (xp != NULL)
|
if (xp != NULL)
|
||||||
{
|
{
|
||||||
xp->xp_arg = uc->uc_compl_arg;
|
xp->xp_arg = uc->uc_compl_arg;
|
||||||
xp->xp_script_ctx = uc->uc_script_ctx;
|
xp->xp_script_ctx = uc->uc_script_ctx;
|
||||||
xp->xp_script_ctx.sc_lnum += sourcing_lnum;
|
xp->xp_script_ctx.sc_lnum += sourcing_lnum;
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
# endif
|
# endif
|
||||||
// Do not search for further abbreviations
|
// Do not search for further abbreviations
|
||||||
// if this is an exact match.
|
// if this is an exact match.
|
||||||
@@ -232,8 +228,6 @@ find_ucmd(
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
char_u *
|
char_u *
|
||||||
set_context_in_user_cmd(expand_T *xp, char_u *arg_in)
|
set_context_in_user_cmd(expand_T *xp, char_u *arg_in)
|
||||||
{
|
{
|
||||||
@@ -384,8 +378,6 @@ cmdcomplete_str_to_type(char_u *complete_str)
|
|||||||
return EXPAND_NOTHING;
|
return EXPAND_NOTHING;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FEAT_CMDL_COMPL
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* List user commands starting with "name[name_len]".
|
* List user commands starting with "name[name_len]".
|
||||||
*/
|
*/
|
||||||
@@ -622,7 +614,7 @@ parse_compl_arg(
|
|||||||
char_u **compl_arg UNUSED)
|
char_u **compl_arg UNUSED)
|
||||||
{
|
{
|
||||||
char_u *arg = NULL;
|
char_u *arg = NULL;
|
||||||
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
# if defined(FEAT_EVAL)
|
||||||
size_t arglen = 0;
|
size_t arglen = 0;
|
||||||
# endif
|
# endif
|
||||||
int i;
|
int i;
|
||||||
@@ -634,7 +626,7 @@ parse_compl_arg(
|
|||||||
if (value[i] == ',')
|
if (value[i] == ',')
|
||||||
{
|
{
|
||||||
arg = &value[i + 1];
|
arg = &value[i + 1];
|
||||||
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
# if defined(FEAT_EVAL)
|
||||||
arglen = vallen - i - 1;
|
arglen = vallen - i - 1;
|
||||||
# endif
|
# endif
|
||||||
valend = i;
|
valend = i;
|
||||||
@@ -663,7 +655,7 @@ parse_compl_arg(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
# if defined(FEAT_EVAL)
|
||||||
if (*complp != EXPAND_USER_DEFINED && *complp != EXPAND_USER_LIST
|
if (*complp != EXPAND_USER_DEFINED && *complp != EXPAND_USER_LIST
|
||||||
&& arg != NULL)
|
&& arg != NULL)
|
||||||
# else
|
# else
|
||||||
@@ -674,7 +666,7 @@ parse_compl_arg(
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
# if defined(FEAT_EVAL)
|
||||||
if ((*complp == EXPAND_USER_DEFINED || *complp == EXPAND_USER_LIST)
|
if ((*complp == EXPAND_USER_DEFINED || *complp == EXPAND_USER_LIST)
|
||||||
&& arg == NULL)
|
&& arg == NULL)
|
||||||
{
|
{
|
||||||
@@ -930,7 +922,7 @@ uc_add_command(
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIM_CLEAR(cmd->uc_rep);
|
VIM_CLEAR(cmd->uc_rep);
|
||||||
#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
#if defined(FEAT_EVAL)
|
||||||
VIM_CLEAR(cmd->uc_compl_arg);
|
VIM_CLEAR(cmd->uc_compl_arg);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
@@ -964,9 +956,7 @@ uc_add_command(
|
|||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
cmd->uc_script_ctx = current_sctx;
|
cmd->uc_script_ctx = current_sctx;
|
||||||
cmd->uc_script_ctx.sc_lnum += sourcing_lnum;
|
cmd->uc_script_ctx.sc_lnum += sourcing_lnum;
|
||||||
# ifdef FEAT_CMDL_COMPL
|
|
||||||
cmd->uc_compl_arg = compl_arg;
|
cmd->uc_compl_arg = compl_arg;
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
cmd->uc_addr_type = addr_type;
|
cmd->uc_addr_type = addr_type;
|
||||||
|
|
||||||
@@ -974,7 +964,7 @@ uc_add_command(
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
vim_free(rep_buf);
|
vim_free(rep_buf);
|
||||||
#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
#if defined(FEAT_EVAL)
|
||||||
vim_free(compl_arg);
|
vim_free(compl_arg);
|
||||||
#endif
|
#endif
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@@ -1074,7 +1064,7 @@ uc_clear(garray_T *gap)
|
|||||||
cmd = USER_CMD_GA(gap, i);
|
cmd = USER_CMD_GA(gap, i);
|
||||||
vim_free(cmd->uc_name);
|
vim_free(cmd->uc_name);
|
||||||
vim_free(cmd->uc_rep);
|
vim_free(cmd->uc_rep);
|
||||||
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
# if defined(FEAT_EVAL)
|
||||||
vim_free(cmd->uc_compl_arg);
|
vim_free(cmd->uc_compl_arg);
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
@@ -1115,7 +1105,7 @@ ex_delcommand(exarg_T *eap)
|
|||||||
|
|
||||||
vim_free(cmd->uc_name);
|
vim_free(cmd->uc_name);
|
||||||
vim_free(cmd->uc_rep);
|
vim_free(cmd->uc_rep);
|
||||||
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
# if defined(FEAT_EVAL)
|
||||||
vim_free(cmd->uc_compl_arg);
|
vim_free(cmd->uc_compl_arg);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|||||||
@@ -2793,8 +2793,6 @@ get_expanded_name(char_u *name, int check)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function given to ExpandGeneric() to obtain the list of user defined
|
* Function given to ExpandGeneric() to obtain the list of user defined
|
||||||
* function names.
|
* function names.
|
||||||
@@ -2838,8 +2836,6 @@ get_user_func_name(expand_T *xp, int idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* FEAT_CMDL_COMPL */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ":delfunction {name}"
|
* ":delfunction {name}"
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -158,11 +158,7 @@ static char *(features[]) =
|
|||||||
#else
|
#else
|
||||||
"-clipboard",
|
"-clipboard",
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_CMDL_COMPL
|
|
||||||
"+cmdline_compl",
|
"+cmdline_compl",
|
||||||
#else
|
|
||||||
"-cmdline_compl",
|
|
||||||
#endif
|
|
||||||
"+cmdline_hist",
|
"+cmdline_hist",
|
||||||
#ifdef FEAT_CMDL_INFO
|
#ifdef FEAT_CMDL_INFO
|
||||||
"+cmdline_info",
|
"+cmdline_info",
|
||||||
@@ -769,6 +765,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 */
|
||||||
|
/**/
|
||||||
|
1887,
|
||||||
/**/
|
/**/
|
||||||
1886,
|
1886,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user