diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option_defs.h | 3 | ||||
-rw-r--r-- | src/nvim/regexp.c | 7 | ||||
-rw-r--r-- | src/nvim/regexp_nfa.c | 2 |
3 files changed, 2 insertions, 10 deletions
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index e73cc4c189..a6b2c3bd6f 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -129,14 +129,13 @@ #define CPO_SPECI '<' /* don't recognize <> in mappings */ #define CPO_REGAPPEND '>' /* insert NL when appending to a register */ /* POSIX flags */ -#define CPO_BACKSL '\\' /* \ is not special in [] */ #define CPO_SCOLON ';' /* using "," and ";" will skip over char if * cursor would not move */ /* default values for Vim, Vi and POSIX */ #define CPO_VIM "aABceFs" #define CPO_VI "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;" #define CPO_ALL \ - "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>\\;" + "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;" /* characters for p_ww option: */ #define WW_ALL "bshl<>[],~" diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 3ae3f46db3..4724a07895 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -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_bsl; /* 'cpoptions' contains '\' flag */ static void get_cpo_flags(void) { 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) mb_ptr_adv(p); } else if (*p == '\\' - && !reg_cpo_bsl && (vim_strchr(REGEXP_INRANGE, p[1]) != NULL || (!reg_cpo_lit && vim_strchr(REGEXP_ABBR, p[1]) != NULL))) p += 2; @@ -2222,7 +2219,7 @@ collection: } /* Handle \o40, \x20 and \u20AC style sequences */ - if (endc == '\\' && !reg_cpo_lit && !reg_cpo_bsl) + if (endc == '\\' && !reg_cpo_lit) endc = coll_get_char(); if (startc > endc) @@ -2245,10 +2242,8 @@ collection: * Only "\]", "\^", "\]" and "\\" are special in Vi. Vim * accepts "\t", "\e", etc., but only when the 'l' flag in * 'cpoptions' is not included. - * Posix doesn't recognize backslash at all. */ else if (*regparse == '\\' - && !reg_cpo_bsl && (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL || (!reg_cpo_lit && vim_strchr(REGEXP_ABBR, diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index d9dc09b623..42cebb0198 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1584,10 +1584,8 @@ collection: * Only "\]", "\^", "\]" and "\\" are special in Vi. Vim * accepts "\t", "\e", etc., but only when the 'l' flag in * 'cpoptions' is not included. - * Posix doesn't recognize backslash at all. */ if (*regparse == '\\' - && !reg_cpo_bsl && regparse + 1 <= endp && (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL || (!reg_cpo_lit |