File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
- *options.txt* For Vim バージョン 9.1. Last change: 2024 Oct 22
1
+ *options.txt* For Vim バージョン 9.1. Last change: 2024 Oct 28
2
2
3
3
4
4
VIMリファレンスマニュアル by Bram Moolenaar
@@ -3587,6 +3587,10 @@ Note 1番目の形式では、行全体がオプション指定に使われる
3587
3587
式は、|:find| コマンドの呼び出しごとに 1 回だけ評価される。
3588
3588
式は、'path' で指定されたすべてのディレクトリを処理できる。
3589
3589
3590
+ 式はコマンドライン補完のためにも評価される可能性があり、その場合、
3591
+ |v:cmdcomplete| 変数は |v:true| に設定され、それ以外の場合は |v:false|
3592
+ に設定される。
3593
+
3590
3594
マッチした場合、式は 1 つ以上のファイル名を含む |List| を返す必要があ
3591
3595
る。マッチしない場合、式は空のリストを返す必要がある。
3592
3596
@@ -3604,7 +3608,8 @@ Note 1番目の形式では、行全体がオプション指定に使われる
3604
3608
>
3605
3609
" glob() を使う
3606
3610
func FindExprGlob()
3607
- return glob(v:fname, v:false, v:true)
3611
+ let pat = v:cmdcomplete ? $'{v:fname}*' : v:fname
3612
+ return glob(pat, v:false, v:true)
3608
3613
endfunc
3609
3614
set findexpr=FindExprGlob()
3610
3615
Original file line number Diff line number Diff line change 1
- *options.txt* For Vim version 9.1. Last change: 2024 Oct 22
1
+ *options.txt* For Vim version 9.1. Last change: 2024 Oct 28
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3567,6 +3567,10 @@ A jump table for the options with a short description can be found at |Q_op|.
3567
3567
The expression is evaluated only once per | :find | command invocation.
3568
3568
The expression can process all the directories specified in 'path' .
3569
3569
3570
+ The expression may be evaluated for command-line completion as well,
3571
+ in which case the | v:cmdcomplete | variable will be set to | v:true | ,
3572
+ otherwise it will be set to | v:false | .
3573
+
3570
3574
If a match is found, the expression should return a | List | containing
3571
3575
one or more file names. If a match is not found, the expression
3572
3576
should return an empty List.
@@ -3586,7 +3590,8 @@ A jump table for the options with a short description can be found at |Q_op|.
3586
3590
>
3587
3591
" Use glob()
3588
3592
func FindExprGlob()
3589
- return glob(v:fname, v:false, v:true)
3593
+ let pat = v:cmdcomplete ? $'{v:fname}*' : v:fname
3594
+ return glob(pat, v:false, v:true)
3590
3595
endfunc
3591
3596
set findexpr=FindExprGlob()
3592
3597
You can’t perform that action at this time.
0 commit comments