diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-10-01 19:41:48 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2016-10-01 19:54:35 +0900 |
commit | de802fd4d22e813713bbd6825bfd75c5287a50b4 (patch) | |
tree | 74858886d2820935e608b14cae01cf6c41cd0af7 /src | |
parent | aeebed8d611b61ca8e4d469d0f3c0405a9d0f369 (diff) | |
download | rneovim-de802fd4d22e813713bbd6825bfd75c5287a50b4.tar.gz rneovim-de802fd4d22e813713bbd6825bfd75c5287a50b4.tar.bz2 rneovim-de802fd4d22e813713bbd6825bfd75c5287a50b4.zip |
vim-patch:7.4.2162
Problem: Result of getcompletion('', 'sign') depends on previous
completion.
Solution: Call set_context_in_sign_cmd(). (Dominique Pelle)
https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 5 | ||||
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 16 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 264472510c..82a6c12551 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -9678,6 +9678,11 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) xpc.xp_pattern_len = STRLEN(xpc.xp_pattern); } + if (xpc.xp_context == EXPAND_SIGN) { + set_context_in_sign_cmd(&xpc, xpc.xp_pattern); + xpc.xp_pattern_len = STRLEN(xpc.xp_pattern); + } + pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); rettv_list_alloc(rettv); if (pat != NULL) { diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 25a6e7200f..796fbdd45a 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -134,6 +134,19 @@ func Test_getcompletion() call assert_equal(keys, l) endif + if has('signs') + sign define Testing linehl=Comment + let l = getcompletion('', 'sign') + let cmds = ['define', 'jump', 'list', 'place', 'undefine', 'unplace'] + call assert_equal(cmds, l) + " using cmdline completion must not change the result + call feedkeys(":sign list \<c-d>\<c-c>", 'xt') + let l = getcompletion('', 'sign') + call assert_equal(cmds, l) + let l = getcompletion('list ', 'sign') + call assert_equal(['Testing'], l) + endif + " For others test if the name is recognized. let names = ['buffer', 'environment', 'file_in_path', \ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user'] @@ -146,9 +159,6 @@ func Test_getcompletion() if has('profile') call add(names, 'syntime') endif - if has('signs') - call add(names, 'sign') - endif set tags=Xtags call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags') diff --git a/src/nvim/version.c b/src/nvim/version.c index c991514482..508d1e8921 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -279,7 +279,7 @@ static int included_patches[] = { // 2165, // 2164, // 2163, - // 2162, + 2162, // 2161, // 2160, // 2159, |