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
b19afa52c4
commit
3931a36340
@ -714,9 +714,6 @@ When the {string} starts with "\=" it is evaluated as an expression, see
|
|||||||
characters.
|
characters.
|
||||||
|
|
||||||
Otherwise these characters in {string} have a special meaning:
|
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 ~
|
magic nomagic action ~
|
||||||
& \& replaced with the whole matched pattern *s/\&*
|
& \& 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 '-'
|
'\' included: "/[ \-]" finds <Space>, '\' and '-'
|
||||||
'\' excluded: "/[ \-]" finds <Space> and '-'
|
'\' excluded: "/[ \-]" finds <Space> and '-'
|
||||||
Also see |cpo-l|.
|
Also see |cpo-l|.
|
||||||
*cpo-/*
|
|
||||||
/ When "%" is used as the replacement string in a |:s|
|
|
||||||
command, use the previous replacement string. |:s%|
|
|
||||||
*cpo-.*
|
*cpo-.*
|
||||||
. The ":chdir" and ":cd" commands fail if the current
|
. The ":chdir" and ":cd" commands fail if the current
|
||||||
buffer is modified, unless ! is used. Vim doesn't
|
buffer is modified, unless ! is used. Vim doesn't
|
||||||
|
@ -3472,18 +3472,8 @@ void do_sub(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!eap->skip) {
|
if (!eap->skip) {
|
||||||
/* In POSIX vi ":s/pat/%/" uses the previous subst. string. */
|
xfree(old_sub);
|
||||||
if (STRCMP(sub, "%") == 0
|
old_sub = vim_strsave(sub);
|
||||||
&& 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 */
|
} else if (!eap->skip) { /* use previous pattern and substitution */
|
||||||
if (old_sub == NULL) { /* there is no previous command */
|
if (old_sub == NULL) { /* there is no previous command */
|
||||||
|
@ -129,7 +129,6 @@
|
|||||||
#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_SUBPERCENT '/' /* % in :s string uses previous one */
|
|
||||||
#define CPO_BACKSL '\\' /* \ is not special in [] */
|
#define CPO_BACKSL '\\' /* \ is not special in [] */
|
||||||
#define CPO_CHDIR '.' /* don't chdir if buffer is modified */
|
#define CPO_CHDIR '.' /* don't chdir if buffer is modified */
|
||||||
#define CPO_SCOLON ';' /* using "," and ";" will skip over char if
|
#define CPO_SCOLON ';' /* using "," and ";" will skip over char if
|
||||||
@ -138,7 +137,7 @@
|
|||||||
#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<>[],~"
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -126,10 +126,6 @@ TEST_6:
|
|||||||
STARTTEST
|
STARTTEST
|
||||||
:set magic&
|
:set magic&
|
||||||
:$put =\"\n\nTEST_6:\"
|
:$put =\"\n\nTEST_6:\"
|
||||||
:set cpo+=/
|
|
||||||
:$put =substitute('A', 'A', 'a', '')
|
|
||||||
:$put =substitute('B', 'B', '%', '')
|
|
||||||
:set cpo-=/
|
|
||||||
:$put =substitute('C', 'C', 'c', '')
|
:$put =substitute('C', 'C', 'c', '')
|
||||||
:$put =substitute('D', 'D', '%', '')
|
:$put =substitute('D', 'D', '%', '')
|
||||||
/^TEST_7
|
/^TEST_7
|
||||||
|
@ -94,8 +94,6 @@ A123456789987654321
|
|||||||
|
|
||||||
|
|
||||||
TEST_6:
|
TEST_6:
|
||||||
a
|
|
||||||
%
|
|
||||||
c
|
c
|
||||||
%
|
%
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user