mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.1.1769: 'shellslash' is also used for completion
Problem: 'shellslash' is also used for completion. Solution: Add the 'completeslash' option. (Yasuhiro Matsumoto, closes #3612)
This commit is contained in:
33
src/option.c
33
src/option.c
@@ -88,6 +88,7 @@
|
||||
# define PV_DICT OPT_BOTH(OPT_BUF(BV_DICT))
|
||||
# define PV_TSR OPT_BOTH(OPT_BUF(BV_TSR))
|
||||
#endif
|
||||
#define PV_CSL OPT_BUF(BV_CSL)
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
# define PV_CFU OPT_BUF(BV_CFU)
|
||||
#endif
|
||||
@@ -890,6 +891,15 @@ static struct vimoption options[] =
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)0L, (char_u *)0L}
|
||||
#endif
|
||||
SCTX_INIT},
|
||||
{"completeslash", "csl", P_STRING|P_VI_DEF|P_VIM,
|
||||
#if defined(FEAT_INS_EXPAND) && defined(BACKSLASH_IN_FILENAME)
|
||||
(char_u *)&p_csl, PV_CSL,
|
||||
{(char_u *)"", (char_u *)0L}
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)0L, (char_u *)0L}
|
||||
#endif
|
||||
SCTX_INIT},
|
||||
{"confirm", "cf", P_BOOL|P_VI_DEF,
|
||||
@@ -3238,6 +3248,9 @@ static char *(p_fcl_values[]) = {"all", NULL};
|
||||
#endif
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "noinsert", "noselect", NULL};
|
||||
# ifdef BACKSLASH_IN_FILENAME
|
||||
static char *(p_csl_values[]) = {"slash", "backslash", NULL};
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_SIGNS
|
||||
static char *(p_scl_values[]) = {"yes", "no", "auto", "number", NULL};
|
||||
@@ -7409,7 +7422,7 @@ did_set_string_option(
|
||||
}
|
||||
}
|
||||
|
||||
/* 'completeopt' */
|
||||
// 'completeopt'
|
||||
else if (varp == &p_cot)
|
||||
{
|
||||
if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK)
|
||||
@@ -7417,7 +7430,16 @@ did_set_string_option(
|
||||
else
|
||||
completeopt_was_set();
|
||||
}
|
||||
#endif /* FEAT_INS_EXPAND */
|
||||
|
||||
# ifdef BACKSLASH_IN_FILENAME
|
||||
// 'completeslash'
|
||||
else if (varp == &curbuf->b_p_csl)
|
||||
{
|
||||
if (check_opt_strings(p_csl, p_csl_values, FALSE) != OK)
|
||||
errmsg = e_invarg;
|
||||
}
|
||||
# endif
|
||||
#endif // FEAT_INS_EXPAND
|
||||
|
||||
#ifdef FEAT_SIGNS
|
||||
// 'signcolumn'
|
||||
@@ -11110,7 +11132,6 @@ get_varp(struct vimoption *p)
|
||||
#endif
|
||||
case PV_MENC: return *curbuf->b_p_menc != NUL
|
||||
? (char_u *)&(curbuf->b_p_menc) : p->var;
|
||||
|
||||
#ifdef FEAT_ARABIC
|
||||
case PV_ARAB: return (char_u *)&(curwin->w_p_arab);
|
||||
#endif
|
||||
@@ -11197,6 +11218,9 @@ get_varp(struct vimoption *p)
|
||||
#endif
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
case PV_CPT: return (char_u *)&(curbuf->b_p_cpt);
|
||||
# ifdef BACKSLASH_IN_FILENAME
|
||||
case PV_CSL: return (char_u *)&(curbuf->b_p_csl);
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
case PV_CFU: return (char_u *)&(curbuf->b_p_cfu);
|
||||
@@ -11591,6 +11615,9 @@ buf_copy_options(buf_T *buf, int flags)
|
||||
buf->b_p_swf = cmdmod.noswapfile ? FALSE : p_swf;
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
buf->b_p_cpt = vim_strsave(p_cpt);
|
||||
# ifdef BACKSLASH_IN_FILENAME
|
||||
buf->b_p_csl = vim_strsave(p_csl);
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
buf->b_p_cfu = vim_strsave(p_cfu);
|
||||
|
Reference in New Issue
Block a user