Remove POSIX 'cpoptions': '/'

This commit is contained in:
Michael Reed 2015-07-03 05:18:05 -04:00
parent b19afa52c4
commit 3931a36340
8 changed files with 3 additions and 26 deletions

View File

@ -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/\&*

View File

@ -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

View File

@ -3472,18 +3472,8 @@ 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);
}
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 */

View File

@ -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.

View File

@ -126,10 +126,6 @@ TEST_6:
STARTTEST
:set magic&
:$put =\"\n\nTEST_6:\"
:set cpo+=/
:$put =substitute('A', 'A', 'a', '')
:$put =substitute('B', 'B', '%', '')
:set cpo-=/
:$put =substitute('C', 'C', 'c', '')
:$put =substitute('D', 'D', '%', '')
/^TEST_7

View File

@ -94,8 +94,6 @@ A123456789987654321
TEST_6:
a
%
c
%