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:
26
src/option.c
26
src/option.c
@@ -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' */
|
||||
|
Reference in New Issue
Block a user