mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Remove POSIX 'cpoptions': '\'
This commit is contained in:
parent
0661411bba
commit
4f444ae4f8
@ -1945,14 +1945,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
POSIX flags. These are not included in the Vi default value, except
|
POSIX flags. These are not included in the Vi default value, except
|
||||||
when $VIM_POSIX was set on startup. |posix|
|
when $VIM_POSIX was set on startup. |posix|
|
||||||
|
|
||||||
contains behavior ~
|
|
||||||
*cpo-\*
|
|
||||||
\ Backslash in a [] range in a search pattern is taken
|
|
||||||
literally, only "\]" is special See |/[]|
|
|
||||||
'\' included: "/[ \-]" finds <Space>, '\' and '-'
|
|
||||||
'\' excluded: "/[ \-]" finds <Space> and '-'
|
|
||||||
Also see |cpo-l|.
|
|
||||||
|
|
||||||
*'cryptmethod'* *'cm'*
|
*'cryptmethod'* *'cm'*
|
||||||
'cryptmethod' Removed. |vim-differences| {Nvim}
|
'cryptmethod' Removed. |vim-differences| {Nvim}
|
||||||
|
|
||||||
|
@ -129,14 +129,13 @@
|
|||||||
#define CPO_SPECI '<' /* don't recognize <> in mappings */
|
#define CPO_SPECI '<' /* don't recognize <> in mappings */
|
||||||
#define CPO_REGAPPEND '>' /* insert NL when appending to a register */
|
#define CPO_REGAPPEND '>' /* insert NL when appending to a register */
|
||||||
/* POSIX flags */
|
/* POSIX flags */
|
||||||
#define CPO_BACKSL '\\' /* \ is not special in [] */
|
|
||||||
#define CPO_SCOLON ';' /* using "," and ";" will skip over char if
|
#define CPO_SCOLON ';' /* using "," and ";" will skip over char if
|
||||||
* cursor would not move */
|
* cursor would not move */
|
||||||
/* default values for Vim, Vi and POSIX */
|
/* default values for Vim, Vi and POSIX */
|
||||||
#define CPO_VIM "aABceFs"
|
#define CPO_VIM "aABceFs"
|
||||||
#define CPO_VI "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;"
|
#define CPO_VI "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;"
|
||||||
#define CPO_ALL \
|
#define CPO_ALL \
|
||||||
"aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>\\;"
|
"aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;"
|
||||||
|
|
||||||
/* characters for p_ww option: */
|
/* characters for p_ww option: */
|
||||||
#define WW_ALL "bshl<>[],~"
|
#define WW_ALL "bshl<>[],~"
|
||||||
|
@ -1120,12 +1120,10 @@ static int get_coll_element(char_u **pp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int reg_cpo_lit; /* 'cpoptions' contains 'l' flag */
|
static int reg_cpo_lit; /* 'cpoptions' contains 'l' flag */
|
||||||
static int reg_cpo_bsl; /* 'cpoptions' contains '\' flag */
|
|
||||||
|
|
||||||
static void get_cpo_flags(void)
|
static void get_cpo_flags(void)
|
||||||
{
|
{
|
||||||
reg_cpo_lit = vim_strchr(p_cpo, CPO_LITERAL) != NULL;
|
reg_cpo_lit = vim_strchr(p_cpo, CPO_LITERAL) != NULL;
|
||||||
reg_cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1149,7 +1147,6 @@ static char_u *skip_anyof(char_u *p)
|
|||||||
if (*p != ']' && *p != NUL)
|
if (*p != ']' && *p != NUL)
|
||||||
mb_ptr_adv(p);
|
mb_ptr_adv(p);
|
||||||
} else if (*p == '\\'
|
} else if (*p == '\\'
|
||||||
&& !reg_cpo_bsl
|
|
||||||
&& (vim_strchr(REGEXP_INRANGE, p[1]) != NULL
|
&& (vim_strchr(REGEXP_INRANGE, p[1]) != NULL
|
||||||
|| (!reg_cpo_lit && vim_strchr(REGEXP_ABBR, p[1]) != NULL)))
|
|| (!reg_cpo_lit && vim_strchr(REGEXP_ABBR, p[1]) != NULL)))
|
||||||
p += 2;
|
p += 2;
|
||||||
@ -2222,7 +2219,7 @@ collection:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handle \o40, \x20 and \u20AC style sequences */
|
/* Handle \o40, \x20 and \u20AC style sequences */
|
||||||
if (endc == '\\' && !reg_cpo_lit && !reg_cpo_bsl)
|
if (endc == '\\' && !reg_cpo_lit)
|
||||||
endc = coll_get_char();
|
endc = coll_get_char();
|
||||||
|
|
||||||
if (startc > endc)
|
if (startc > endc)
|
||||||
@ -2245,10 +2242,8 @@ collection:
|
|||||||
* Only "\]", "\^", "\]" and "\\" are special in Vi. Vim
|
* Only "\]", "\^", "\]" and "\\" are special in Vi. Vim
|
||||||
* accepts "\t", "\e", etc., but only when the 'l' flag in
|
* accepts "\t", "\e", etc., but only when the 'l' flag in
|
||||||
* 'cpoptions' is not included.
|
* 'cpoptions' is not included.
|
||||||
* Posix doesn't recognize backslash at all.
|
|
||||||
*/
|
*/
|
||||||
else if (*regparse == '\\'
|
else if (*regparse == '\\'
|
||||||
&& !reg_cpo_bsl
|
|
||||||
&& (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL
|
&& (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL
|
||||||
|| (!reg_cpo_lit
|
|| (!reg_cpo_lit
|
||||||
&& vim_strchr(REGEXP_ABBR,
|
&& vim_strchr(REGEXP_ABBR,
|
||||||
|
@ -1584,10 +1584,8 @@ collection:
|
|||||||
* Only "\]", "\^", "\]" and "\\" are special in Vi. Vim
|
* Only "\]", "\^", "\]" and "\\" are special in Vi. Vim
|
||||||
* accepts "\t", "\e", etc., but only when the 'l' flag in
|
* accepts "\t", "\e", etc., but only when the 'l' flag in
|
||||||
* 'cpoptions' is not included.
|
* 'cpoptions' is not included.
|
||||||
* Posix doesn't recognize backslash at all.
|
|
||||||
*/
|
*/
|
||||||
if (*regparse == '\\'
|
if (*regparse == '\\'
|
||||||
&& !reg_cpo_bsl
|
|
||||||
&& regparse + 1 <= endp
|
&& regparse + 1 <= endp
|
||||||
&& (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL
|
&& (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL
|
||||||
|| (!reg_cpo_lit
|
|| (!reg_cpo_lit
|
||||||
|
Loading…
Reference in New Issue
Block a user