mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
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:
@@ -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' */
|
||||
|
Reference in New Issue
Block a user