mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.2162
Problem: Result of getcompletion('', 'sign') depends on previous
completion.
Solution: Call set_context_in_sign_cmd(). (Dominique Pelle)
7522f69821
This commit is contained in:
parent
aeebed8d61
commit
de802fd4d2
@ -9678,6 +9678,11 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
|
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);
|
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
|
||||||
rettv_list_alloc(rettv);
|
rettv_list_alloc(rettv);
|
||||||
if (pat != NULL) {
|
if (pat != NULL) {
|
||||||
|
@ -134,6 +134,19 @@ func Test_getcompletion()
|
|||||||
call assert_equal(keys, l)
|
call assert_equal(keys, l)
|
||||||
endif
|
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.
|
" For others test if the name is recognized.
|
||||||
let names = ['buffer', 'environment', 'file_in_path',
|
let names = ['buffer', 'environment', 'file_in_path',
|
||||||
\ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user']
|
\ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user']
|
||||||
@ -146,9 +159,6 @@ func Test_getcompletion()
|
|||||||
if has('profile')
|
if has('profile')
|
||||||
call add(names, 'syntime')
|
call add(names, 'syntime')
|
||||||
endif
|
endif
|
||||||
if has('signs')
|
|
||||||
call add(names, 'sign')
|
|
||||||
endif
|
|
||||||
|
|
||||||
set tags=Xtags
|
set tags=Xtags
|
||||||
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags')
|
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags')
|
||||||
|
@ -279,7 +279,7 @@ static int included_patches[] = {
|
|||||||
// 2165,
|
// 2165,
|
||||||
// 2164,
|
// 2164,
|
||||||
// 2163,
|
// 2163,
|
||||||
// 2162,
|
2162,
|
||||||
// 2161,
|
// 2161,
|
||||||
// 2160,
|
// 2160,
|
||||||
// 2159,
|
// 2159,
|
||||||
|
Loading…
Reference in New Issue
Block a user