aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/eval.c5
-rw-r--r--src/nvim/testdir/test_cmdline.vim16
-rw-r--r--src/nvim/version.c2
3 files changed, 19 insertions, 4 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index b05b4c4f7e..264472510c 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -9673,6 +9673,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_CSCOPE) {
+ set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope);
+ 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 902ec1c05d..25a6e7200f 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -121,12 +121,22 @@ func Test_getcompletion()
let l = getcompletion('dark', 'highlight')
call assert_equal([], l)
+ if has('cscope')
+ let l = getcompletion('', 'cscope')
+ let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show']
+ call assert_equal(cmds, l)
+ " using cmdline completion must not change the result
+ call feedkeys(":cscope find \<c-d>\<c-c>", 'xt')
+ let l = getcompletion('', 'cscope')
+ call assert_equal(cmds, l)
+ let keys = ['a', 'c', 'd', 'e', 'f', 'g', 'i', 's', 't']
+ let l = getcompletion('find ', 'cscope')
+ call assert_equal(keys, l)
+ endif
+
" For others test if the name is recognized.
let names = ['buffer', 'environment', 'file_in_path',
\ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user']
- if has('cscope')
- call add(names, 'cscope')
- endif
if has('cmdline_hist')
call add(names, 'history')
endif
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 302e78cb6c..c991514482 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -283,7 +283,7 @@ static int included_patches[] = {
// 2161,
// 2160,
// 2159,
- // 2158,
+ 2158,
// 2157 NA
// 2156 NA
// 2155 NA