diff options
author | watiko <service@mail.watiko.net> | 2016-02-09 14:10:55 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-09 14:44:53 +0900 |
commit | 69e5427be170d98a413edb1e191254f84d8642f6 (patch) | |
tree | 18d43a3130dca89367a1dacff9f7fbcc85076018 | |
parent | c90c47072fbc282c3c6a69d945e9ad7079862a0a (diff) | |
download | rneovim-69e5427be170d98a413edb1e191254f84d8642f6.tar.gz rneovim-69e5427be170d98a413edb1e191254f84d8642f6.tar.bz2 rneovim-69e5427be170d98a413edb1e191254f84d8642f6.zip |
vim-patch:7.4.915
Problem: When removing from 'path' and then adding, a comma may go missing.
(Malcolm Rowe)
Solution: Fix the check for P_ONECOMMA. (closes #471)
https://github.com/vim/vim/commit/174674743d9a2d7361c9cd89836f8dd8651edeeb
-rw-r--r-- | src/nvim/option.c | 3 | ||||
-rw-r--r-- | src/nvim/version.c | 2 | ||||
-rw-r--r-- | test/functional/legacy/options_spec.lua | 22 |
3 files changed, 21 insertions, 6 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 38ce155b24..c11e22703e 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1676,7 +1676,8 @@ do_set ( if (adding) { i = (int)STRLEN(origval); // Strip a trailing comma, would get 2. - if (comma && (flags & P_ONECOMMA) && i > 1 + if (comma && i > 1 + && (flags & P_ONECOMMA) == P_ONECOMMA && origval[i - 1] == ',' && origval[i - 2] != '\\') { i--; diff --git a/src/nvim/version.c b/src/nvim/version.c index cd77a86626..0b5783b41c 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -373,7 +373,7 @@ static int included_patches[] = { // 918 NA // 917 NA 916, - // 915, + 915, // 914, // 913 NA // 912, diff --git a/test/functional/legacy/options_spec.lua b/test/functional/legacy/options_spec.lua index 773acb9663..21e99c4aa1 100644 --- a/test/functional/legacy/options_spec.lua +++ b/test/functional/legacy/options_spec.lua @@ -1,13 +1,27 @@ --- Test if ":options" throws any exception. The options window seems to mess --- other tests, so restart nvim in the teardown hook - local helpers = require('test.functional.helpers') local command, clear = helpers.command, helpers.clear +local source, expect = helpers.source, helpers.expect describe('options', function() setup(clear) - it('is working', function() + it('should not throw any exception', function() command('options') end) end) + +describe('set', function() + setup(clear) + + it("should keep two comma when 'path' is changed", function() + source([[ + set path=foo,,bar + set path-=bar + set path+=bar + $put =&path]]) + + expect([[ + + foo,,bar]]) + end) +end) |