vim-patch:7.4.2174

Problem:    Adding duplicate flags to 'whichwrap' leaves commas behind.
Solution:   Also remove the commas. (Naruhiko Nishino)

c8ce615299
This commit is contained in:
James McCoy
2016-11-15 10:14:12 -05:00
parent 10c72cd365
commit 9d9d93aee3
4 changed files with 59 additions and 6 deletions

View File

@@ -1728,12 +1728,24 @@ do_set (
if (flags & P_FLAGLIST) {
/* Remove flags that appear twice. */
for (s = newval; *s; ++s)
if ((!(flags & P_COMMA) || *s != ',')
&& vim_strchr(s + 1, *s) != NULL) {
STRMOVE(s, s + 1);
--s;
for (s = newval; *s; s++) {
// if options have P_FLAGLIST and P_ONECOMMA such as
// 'whichwrap'
if (flags & P_ONECOMMA) {
if (*s != ',' && *(s + 1) == ','
&& vim_strchr(s + 2, *s) != NULL) {
// Remove the duplicated value and the next comma.
STRMOVE(s, s + 2);
s -= 2;
}
} else {
if ((!(flags & P_COMMA) || *s != ',')
&& vim_strchr(s + 1, *s) != NULL) {
STRMOVE(s, s + 1);
s--;
}
}
}
}
if (save_arg != NULL) /* number for 'whichwrap' */