diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-05-21 00:05:37 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-05-21 00:05:37 -0400 |
commit | 8e20ba9fbd691955fa20bdba3dd5ff66d16f923c (patch) | |
tree | c2cbd4dcbff0040d77ba1c1a6577f6947fccd9e9 /src/nvim/option.c | |
parent | 9d3449852bd35c9283948186d0259c1bf73b8579 (diff) | |
parent | 853440053c3495958644cb6deabde733ede5dd56 (diff) | |
download | rneovim-8e20ba9fbd691955fa20bdba3dd5ff66d16f923c.tar.gz rneovim-8e20ba9fbd691955fa20bdba3dd5ff66d16f923c.tar.bz2 rneovim-8e20ba9fbd691955fa20bdba3dd5ff66d16f923c.zip |
Merge pull request #4737 from jamessan/vim-7.4.1017
https://github.com/neovim/neovim/pull/4789C] vim-patch:7.4.1017,7.4.1018,7.4.1034
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 2f22c245dd..45ebb4fa4c 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1639,18 +1639,21 @@ do_set ( && STRNCMP(s, newval, i) == 0 && (!(flags & P_COMMA) || s[i] == ',' - || s[i] == NUL)) + || s[i] == NUL)) { break; - /* Count backslashes. Only a comma with an - * even number of backslashes before it is - * recognized as a separator */ - if (s > origval && s[-1] == '\\') - ++bs; - else + } + // Count backslashes. Only a comma with an even number of + // backslashes or a single backslash preceded by a comma + // before it is recognized as a separator + if ((s > origval + 1 && s[-1] == '\\' && s[-2] != ',') + || (s == origval + 1 && s[-1] == '\\')) { + bs++; + } else { bs = 0; + } } - /* do not add if already there */ + // do not add if already there if ((adding || prepending) && *s) { prepending = FALSE; adding = FALSE; |