mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3337: completing "call g:" returns entries with just "g:"
Problem: Completing "call g:" returns entries with just "g:". (Naohiro Ono)
Solution: Skip empty strings returned by get_user_func_name(). (closes vim/vim#8753)
069f90852f
This commit is contained in:
parent
b24c377c8a
commit
2ddfd6b999
@ -119,7 +119,7 @@ char_u *get_function_name(expand_T *xp, int idx)
|
||||
intidx = -1;
|
||||
if (intidx < 0) {
|
||||
name = get_user_func_name(xp, idx);
|
||||
if (name != NULL) {
|
||||
if (name != NULL && *name != NUL) {
|
||||
if (*name != '<' && STRNCMP("g:", xp->xp_pattern, 2) == 0) {
|
||||
return cat_prefix_varname('g', name);
|
||||
}
|
||||
|
@ -602,6 +602,11 @@ func Test_cmdline_complete_user_func()
|
||||
" g: prefix also works
|
||||
call feedkeys(":echo g:Test_cmdline_complete_user_f\<Tab>\<Home>\"\<cr>", 'tx')
|
||||
call assert_match('"echo g:Test_cmdline_complete_user_func', @:)
|
||||
|
||||
" using g: prefix does not result in just "g:" matches from a lambda
|
||||
let Fx = { a -> a }
|
||||
call feedkeys(":echo g:\<Tab>\<Home>\"\<cr>", 'tx')
|
||||
call assert_match('"echo g:[A-Z]', @:)
|
||||
endfunc
|
||||
|
||||
func Test_cmdline_complete_user_names()
|
||||
|
Loading…
Reference in New Issue
Block a user