mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 17:58:18 +00:00
Remove POSIX 'cpoptions': '/'
This commit is contained in:
@@ -714,9 +714,6 @@ When the {string} starts with "\=" it is evaluated as an expression, see
|
||||
characters.
|
||||
|
||||
Otherwise these characters in {string} have a special meaning:
|
||||
*:s%*
|
||||
When {string} is equal to "%" and '/' is included with the 'cpoptions' option,
|
||||
then the {string} of the previous substitute command is used, see |cpo-/|
|
||||
|
||||
magic nomagic action ~
|
||||
& \& replaced with the whole matched pattern *s/\&*
|
||||
|
@@ -1952,9 +1952,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'\' included: "/[ \-]" finds <Space>, '\' and '-'
|
||||
'\' excluded: "/[ \-]" finds <Space> and '-'
|
||||
Also see |cpo-l|.
|
||||
*cpo-/*
|
||||
/ When "%" is used as the replacement string in a |:s|
|
||||
command, use the previous replacement string. |:s%|
|
||||
*cpo-.*
|
||||
. The ":chdir" and ":cd" commands fail if the current
|
||||
buffer is modified, unless ! is used. Vim doesn't
|
||||
|
@@ -3472,19 +3472,9 @@ void do_sub(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (!eap->skip) {
|
||||
/* In POSIX vi ":s/pat/%/" uses the previous subst. string. */
|
||||
if (STRCMP(sub, "%") == 0
|
||||
&& vim_strchr(p_cpo, CPO_SUBPERCENT) != NULL) {
|
||||
if (old_sub == NULL) { /* there is no previous command */
|
||||
EMSG(_(e_nopresub));
|
||||
return;
|
||||
}
|
||||
sub = old_sub;
|
||||
} else {
|
||||
xfree(old_sub);
|
||||
old_sub = vim_strsave(sub);
|
||||
}
|
||||
}
|
||||
} else if (!eap->skip) { /* use previous pattern and substitution */
|
||||
if (old_sub == NULL) { /* there is no previous command */
|
||||
EMSG(_(e_nopresub));
|
||||
|
@@ -129,7 +129,6 @@
|
||||
#define CPO_SPECI '<' /* don't recognize <> in mappings */
|
||||
#define CPO_REGAPPEND '>' /* insert NL when appending to a register */
|
||||
/* POSIX flags */
|
||||
#define CPO_SUBPERCENT '/' /* % in :s string uses previous one */
|
||||
#define CPO_BACKSL '\\' /* \ is not special in [] */
|
||||
#define CPO_CHDIR '.' /* don't chdir if buffer is modified */
|
||||
#define CPO_SCOLON ';' /* using "," and ";" will skip over char if
|
||||
@@ -138,7 +137,7 @@
|
||||
#define CPO_VIM "aABceFs"
|
||||
#define CPO_VI "aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>;"
|
||||
#define CPO_ALL \
|
||||
"aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>/\\.;"
|
||||
"aAbBcCdDeEfFiIJkKlLmMnoOpPqrRsStuvWxXyZ$!%+<>\\.;"
|
||||
|
||||
/* characters for p_ww option: */
|
||||
#define WW_ALL "bshl<>[],~"
|
||||
|
Binary file not shown.
Binary file not shown.
@@ -126,10 +126,6 @@ TEST_6:
|
||||
:set magic&
|
||||
:set cpo&
|
||||
:$put =\"\n\nTEST_5:\"
|
||||
:$put =substitute('A123456789', 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)', '\=submatch(0) . submatch(9) . submatch(8) . submatch(7) . submatch(6) . submatch(5) . submatch(4) . submatch(3) . submatch(2) . submatch(1)', '')
|
||||
:$put =substitute('A123456789', 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)', '\=string([submatch(0, 1), submatch(9, 1), submatch(8, 1), submatch(7, 1), submatch(6, 1), submatch(5, 1), submatch(4, 1), submatch(3, 1), submatch(2, 1), submatch(1, 1)])', '')
|
||||
/^TEST_6
|
||||
ENDTEST
|
||||
:$put =substitute('A123456789', 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)', '\=submatch(0) . submatch(9) . submatch(8) . submatch(7) . submatch(6) . submatch(5) . submatch(4) . submatch(3) . submatch(2) . submatch(1)', '')
|
||||
:$put =substitute('A123456789', 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)', '\=string([submatch(0, 1), submatch(9, 1), submatch(8, 1), submatch(7, 1), submatch(6, 1), submatch(5, 1), submatch(4, 1), submatch(3, 1), submatch(2, 1), submatch(1, 1)])', '')
|
||||
/^TEST_6
|
||||
|
@@ -94,8 +94,6 @@ A123456789987654321
|
||||
d
|
||||
d
|
||||
e\
|
||||
e
|
||||
f
|
||||
e
|
||||
f
|
||||
f
|
||||
|
Reference in New Issue
Block a user