aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/options.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/options.txt')
-rw-r--r--runtime/doc/options.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 441f180177..7f95a19918 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2611,6 +2611,10 @@ A jump table for the options with a short description can be found at |Q_op|.
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.
@@ -2630,7 +2634,8 @@ A jump table for the options with a short description can be found at |Q_op|.
>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()