From 60b3ccd850ca038af6fc0a19cad12578f63d67ec Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 29 Oct 2024 07:02:04 +0800 Subject: vim-patch:9.1.0821: 'findexpr' completion doesn't set v:fname to cmdline argument Problem: 'findexpr' completion doesn't set v:fname to cmdline argument. Solution: Set v:fname to the cmdline argument as-is (zeertzjq). closes: vim/vim#15934 https://github.com/vim/vim/commit/20e045f78148c0ef0143c33ffe686fee72d29376 --- src/nvim/options.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/nvim/options.lua') diff --git a/src/nvim/options.lua b/src/nvim/options.lua index 2e037d80d3..d59958eaf2 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2920,6 +2920,10 @@ return { The expression is evaluated only once per |:find| command invocation. The expression can process all the directories specified in 'path'. + The expression may be evaluated for command-line completion as well, + in which case the |v:cmdcomplete| variable will be set to |v:true|, + otherwise it will be set to |v:false|. + If a match is found, the expression should return a |List| containing one or more file names. If a match is not found, the expression should return an empty List. @@ -2939,7 +2943,8 @@ return { >vim " Use glob() func FindExprGlob() - return glob(v:fname, v:false, v:true) + let pat = v:cmdcomplete ? $'{v:fname}*' : v:fname + return glob(pat, v:false, v:true) endfunc set findexpr=FindExprGlob() -- cgit