diff options
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index b4054dc28c..d3a2ce971d 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1432,7 +1432,7 @@ do_set ( } else if (*arg == '-' || ascii_isdigit(*arg)) { // Allow negative (for 'undolevels'), octal and // hex numbers. - vim_str2nr(arg, NULL, &i, true, true, true, &value, NULL); + vim_str2nr(arg, NULL, &i, STR2NR_ALL, &value, NULL, 0); if (arg[i] != NUL && !ascii_iswhite(arg[i])) { errmsg = e_invarg; goto skip; @@ -1673,6 +1673,11 @@ do_set ( && *newval != NUL); if (adding) { i = (int)STRLEN(origval); + // Strip a trailing comma, would get 2. + if (comma && i > 1 && origval[i - 1] == ',' + && origval[i - 2] != '\\') { + --i; + } memmove(newval + i + comma, newval, STRLEN(newval) + 1); memmove(newval, origval, (size_t)i); |