aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJurica Bradaric <jbradaric@gmail.com>2016-01-28 19:28:15 +0100
committerJustin M. Keyes <justinkz@gmail.com>2016-02-01 02:28:51 -0500
commit59ef994f8f5fad9aaaa0e1d6eae3af66f6bb2630 (patch)
tree038fd5dc7cef8d4e48ead63c84208f42eb075b83 /src
parent99067b7e56e0a873bcf333048ed0ba17280957be (diff)
downloadrneovim-59ef994f8f5fad9aaaa0e1d6eae3af66f6bb2630.tar.gz
rneovim-59ef994f8f5fad9aaaa0e1d6eae3af66f6bb2630.tar.bz2
rneovim-59ef994f8f5fad9aaaa0e1d6eae3af66f6bb2630.zip
vim-patch:7.4.741 #4121
Problem: When using += with ":set" a trailing comma is not recognized. (Issue 365) Solution: Don't add a second comma. Add a test. (partly by Christian Brabandt) https://github.com/vim/vim/commit/a7b7b1cef9b61700ba5076c1d889dce791392388
Diffstat (limited to 'src')
-rw-r--r--src/nvim/option.c5
-rw-r--r--src/nvim/version.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 18269f4c18..d3a2ce971d 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -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);
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 99484dd21d..871f96acf4 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -421,7 +421,7 @@ static int included_patches[] = {
// 744 NA
// 743,
// 742,
- // 741,
+ 741,
// 740,
739,
// 738 NA