Skip to content

Commit 63853b8

Browse files
committed
Update by original
1 parent d3220ff commit 63853b8

File tree

2 files changed

+58
-54
lines changed

2 files changed

+58
-54
lines changed

doc/options.jax

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim バージョン 9.1. Last change: 2024 Oct 28
1+
*options.txt* For Vim バージョン 9.1. Last change: 2024 Nov 02
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -469,10 +469,11 @@ Note: 将来的に、より多くのグローバルオプションが |global-lo
469469
れない。
470470

471471
*option-value-function*
472-
いくつかのオプション('completefunc', 'imactivatefunc', 'imstatusfunc',
473-
'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc', 'thesaurusfunc')は
474-
関数名もしくは関数への参照もしくはラムダ関数を設定する。ラムダを使う場合は内部
475-
名へ変換される、例えば "<lambda>123"。例:
472+
いくつかのオプション ('completefunc', 'findfunc', 'imactivatefunc',
473+
'imstatusfunc', 'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc'
474+
および 'thesaurusfunc') は関数名もしくは関数への参照もしくはラムダ関数を設定す
475+
る。ラムダを使う場合は内部名へ変換される、例えば "<lambda>123"。
476+
例:
476477
>
477478
set opfunc=MyOpFunc
478479
set opfunc=function('MyOpFunc')
@@ -3575,30 +3576,32 @@ Note 1番目の形式では、行全体がオプション指定に使われる
35753576
eob EndOfBuffer |hl-EndOfBuffer|
35763577
lastline NonText |hl-NonText|
35773578

3578-
*'findexpr'* *'fexpr'* *E1514*
3579-
'findexpr' 'fexpr' 文字列 (既定では "")
3579+
*'findfunc'* *'ffu'* *E1514*
3580+
'findfunc' 'ffu' 文字列 (既定では "")
35803581
グローバル/バッファについてローカル |global-local|
35813582
{|+eval| 機能つきでコンパイルされたときのみ有効}
3582-
|:find| コマンドのファイル名を取得するために評価される式。このオプショ
3583-
ンが空の場合、内部の |file-searching| メカニズムが使用される。
3584-
3585-
式の評価中、|v:fname| 変数は |:find| コマンドの引数に設定される。
3583+
|:find| コマンドのファイル名を取得するために呼び出される関数。このオプ
3584+
ションが空の場合、内部の |file-searching| メカニズムが使用される。
35863585

3587-
式は、|:find| コマンドの呼び出しごとに 1 回だけ評価される
3588-
式は、'path' で指定されたすべてのディレクトリを処理できる
3586+
値には関数名、|lambda| または |Funcref| を指定できる
3587+
詳細については |option-value-function| を参照
35893588

3590-
式はコマンドライン補完のためにも評価される可能性があり、その場合、
3591-
|v:cmdcomplete| 変数は |v:true| に設定され、それ以外の場合は |v:false|
3592-
に設定される。
3589+
関数は 2 つの引数で呼び出される。最初の引数は |String| で、|:find| コ
3590+
マンドの引数である。2 番目の引数は |Boolean| で、関数が呼び出されて
3591+
|:find| コマンドのコマンドライン補完にマッチしたリストを取得した時に
3592+
|v:true| に設定される。
3593+
関数は文字列のリストを返す必要がある。
35933594

3594-
マッチした場合、式は 1 つ以上のファイル名を含む |List| を返す必要があ
3595-
る。マッチしない場合、式は空のリストを返す必要がある
3595+
関数は、|:find| コマンドの呼び出しごとに 1 回だけ呼び出される。
3596+
関数は、'path' で指定されたすべてのディレクトリを処理できる
35963597

3597-
式の評価中にエラーが発生した場合、空のリストが戻り値として使用される。
3598+
マッチした場合、関数は 1 つ以上のファイル名を含む |List| を返す必要が
3599+
ある。マッチしない場合、関数は空のリストを返す必要がある。
35983600

3599-
引数なしの関数呼び出しを使用すると高速になる |expr-option-function|
3601+
関数の呼び出し中にエラーが発生した場合、空のリストが戻り値として使用さ
3602+
れる。
36003603

3601-
'findexpr' の評価中にテキストを変更したり、別のウィンドウにジャンプし
3604+
'findfunc' の実行中にテキストを変更したり、別のウィンドウにジャンプし
36023605
たりすることはできない。|textlock|
36033606

36043607
セキュリティ上の理由から、このオプションを |modeline| または |sandbox|
@@ -3607,18 +3610,18 @@ Note 1番目の形式では、行全体がオプション指定に使われる
36073610
例:
36083611
>
36093612
" glob() を使う
3610-
func FindExprGlob()
3611-
let pat = v:cmdcomplete ? $'{v:fname}*' : v:fname
3613+
func FindFuncGlob(cmdarg, cmdcomplete)
3614+
let pat = a:cmdcomplete ? $'{a:cmdarg}*' : a:cmdarg
36123615
return glob(pat, v:false, v:true)
36133616
endfunc
3614-
set findexpr=FindExprGlob()
3617+
set findfunc=FindFuncGlob
36153618

36163619
" 'git ls-files' の出力を使う
3617-
func FindGitFiles()
3620+
func FindGitFiles(cmdarg, cmdcomplete)
36183621
let fnames = systemlist('git ls-files')
3619-
return fnames->filter('v:val =~? v:fname')
3622+
return fnames->filter('v:val =~? a:cmdarg')
36203623
endfunc
3621-
set findexpr=FindGitFiles()
3624+
set findfunc=FindGitFiles
36223625
<
36233626
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
36243627
'fixendofline' 'fixeol' 切替 (既定ではオン)

en/options.txt

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.1. Last change: 2024 Oct 28
1+
*options.txt* For Vim version 9.1. Last change: 2024 Nov 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -439,10 +439,11 @@ Note: In the future more global options can be made |global-local|. Using
439439
":setlocal" on a global option might work differently then.
440440

441441
*option-value-function*
442-
Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc',
443-
'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to
444-
a function name or a function reference or a lambda function. When using a
445-
lambda it will be converted to the name, e.g. "<lambda>123". Examples:
442+
Some options ('completefunc', 'findfunc', 'imactivatefunc', 'imstatusfunc',
443+
'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc')
444+
are set to a function name or a function reference or a lambda function. When
445+
using a lambda it will be converted to the name, e.g. "<lambda>123".
446+
Examples:
446447
>
447448
set opfunc=MyOpFunc
448449
set opfunc=function('MyOpFunc')
@@ -3552,55 +3553,55 @@ A jump table for the options with a short description can be found at |Q_op|.
35523553
eob EndOfBuffer |hl-EndOfBuffer|
35533554
lastline NonText |hl-NonText|
35543555

3555-
*'findexpr'* *'fexpr'* *E1514*
3556-
'findexpr' 'fexpr' string (default "")
3556+
*'findfunc'* *'ffu'* *E1514*
3557+
'findfunc' 'ffu' string (default empty)
35573558
global or local to buffer |global-local|
35583559
{not available when compiled without the |+eval|
35593560
feature}
3560-
Expression that is evaluated to obtain the filename(s) for the |:find|
3561+
Function that is called to obtain the filename(s) for the |:find|
35613562
command. When this option is empty, the internal |file-searching|
35623563
mechanism is used.
35633564

3564-
While evaluating the expression, the |v:fname| variable is set to the
3565-
argument of the |:find| command.
3565+
The value can be the name of a function, a |lambda| or a |Funcref|.
3566+
See |option-value-function| for more information.
35663567

3567-
The expression is evaluated only once per |:find| command invocation.
3568-
The expression can process all the directories specified in 'path'.
3568+
The function is called with two arguments. The first argument is a
3569+
|String| and is the |:find| command argument. The second argument is
3570+
a |Boolean| and is set to |v:true| when the function is called to get
3571+
a List of command-line completion matches for the |:find| command.
3572+
The function should return a List of strings.
35693573

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|.
3574+
The function is called only once per |:find| command invocation.
3575+
The function can process all the directories specified in 'path'.
35733576

3574-
If a match is found, the expression should return a |List| containing
3575-
one or more file names. If a match is not found, the expression
3577+
If a match is found, the function should return a |List| containing
3578+
one or more file names. If a match is not found, the function
35763579
should return an empty List.
35773580

3578-
If any errors are encountered during the expression evaluation, an
3581+
If any errors are encountered during the function invocation, an
35793582
empty List is used as the return value.
35803583

3581-
Using a function call without arguments is faster |expr-option-function|
3582-
35833584
It is not allowed to change text or jump to another window while
3584-
evaluating 'findexpr' |textlock|.
3585+
executing the 'findfunc' |textlock|.
35853586

35863587
This option cannot be set from a |modeline| or in the |sandbox|, for
35873588
security reasons.
35883589

35893590
Examples:
35903591
>
35913592
" Use glob()
3592-
func FindExprGlob()
3593-
let pat = v:cmdcomplete ? $'{v:fname}*' : v:fname
3593+
func FindFuncGlob(cmdarg, cmdcomplete)
3594+
let pat = a:cmdcomplete ? $'{a:cmdarg}*' : a:cmdarg
35943595
return glob(pat, v:false, v:true)
35953596
endfunc
3596-
set findexpr=FindExprGlob()
3597+
set findfunc=FindFuncGlob
35973598
35983599
" Use the 'git ls-files' output
3599-
func FindGitFiles()
3600+
func FindGitFiles(cmdarg, cmdcomplete)
36003601
let fnames = systemlist('git ls-files')
3601-
return fnames->filter('v:val =~? v:fname')
3602+
return fnames->filter('v:val =~? a:cmdarg')
36023603
endfunc
3603-
set findexpr=FindGitFiles()
3604+
set findfunc=FindGitFiles
36043605
<
36053606
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
36063607
'fixendofline' 'fixeol' boolean (default on)

0 commit comments

Comments
 (0)