1
0
forked from aniani/vim

patch 7.4.2174

Problem:    Adding duplicate flags to 'whichwrap' leaves commas behind.
Solution:   Also remove the commas. (Naruhiko Nishino)
This commit is contained in:
Bram Moolenaar
2016-08-07 13:48:20 +02:00
parent 3321e9d8a3
commit c8ce615299
8 changed files with 66 additions and 32 deletions

View File

@@ -4919,12 +4919,30 @@ do_set(
{
/* Remove flags that appear twice. */
for (s = newval; *s; ++s)
if ((!(flags & P_COMMA) || *s != ',')
&& vim_strchr(s + 1, *s) != NULL)
{
/* if options have P_FLAGLIST and
* P_ONECOMMA such as 'whichwrap' */
if (flags & P_ONECOMMA)
{
STRMOVE(s, s + 1);
--s;
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' */