Skip to content

Commit b89fbce

Browse files
authored
Merge pull request #1774 from h-east/update-options
Update options.{txt,jax}
2 parents 9337885 + f89bda1 commit b89fbce

File tree

2 files changed

+63
-49
lines changed

2 files changed

+63
-49
lines changed

doc/options.jax

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim バージョン 9.1. Last change: 2024 Oct 22
1+
*options.txt* For Vim バージョン 9.1. Last change: 2024 Nov 06
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')
@@ -3538,7 +3539,7 @@ Note 1番目の形式では、行全体がオプション指定に使われる
35383539
英数字、'-'、'_' のみ使用できる。
35393540

35403541
*'fillchars'* *'fcs'*
3541-
'fillchars' 'fcs' 文字列 (既定では "vert:|,fold:-,eob:~")
3542+
'fillchars' 'fcs' 文字列 (既定では "vert:|,fold:-,eob:~,lastline:@")
35423543
グローバル/ウィンドウについてローカル |global-local|
35433544
ウィンドウのステータス行、垂直分割の区切り、特殊行を埋める文字。
35443545
これはコンマで区切られた項目のリストである。各項目には、名前、コロン、
@@ -3575,26 +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| メカニズムが使用される。
3583+
|:find| コマンドのファイル名を取得するために呼び出される関数。このオプ
3584+
ションが空の場合、内部の |file-searching| メカニズムが使用される。
35843585

3585-
式の評価中、|v:fname| 変数は |:find| コマンドの引数に設定される。
3586+
値には関数名、|lambda| または |Funcref| を指定できる。
3587+
詳細については |option-value-function| を参照。
35863588

3587-
式は、|:find| コマンドの呼び出しごとに 1 回だけ評価される。
3588-
式は、'path' で指定されたすべてのディレクトリを処理できる。
3589+
関数は 2 つの引数で呼び出される。最初の引数は |String| で、|:find| コ
3590+
マンドの引数である。2 番目の引数は |Boolean| で、関数が呼び出されて
3591+
|:find| コマンドのコマンドライン補完にマッチしたリストを取得した時に
3592+
|v:true| に設定される。
3593+
関数は文字列のリストを返す必要がある。
35893594

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

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

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

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

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

36113619
" 'git ls-files' の出力を使う
3612-
func FindGitFiles()
3620+
func FindGitFiles(cmdarg, cmdcomplete)
36133621
let fnames = systemlist('git ls-files')
3614-
return fnames->filter('v:val =~? v:fname')
3622+
return fnames->filter('v:val =~? a:cmdarg')
36153623
endfunc
3616-
set findexpr=FindGitFiles()
3624+
set findfunc=FindGitFiles
36173625
<
36183626
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
36193627
'fixendofline' 'fixeol' 切替 (既定ではオン)

en/options.txt

Lines changed: 31 additions & 25 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 22
1+
*options.txt* For Vim version 9.1. Last change: 2024 Nov 06
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')
@@ -3514,7 +3515,7 @@ A jump table for the options with a short description can be found at |Q_op|.
35143515
Only alphanumeric characters, '-' and '_' can be used.
35153516

35163517
*'fillchars'* *'fcs'*
3517-
'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~")
3518+
'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~,lastline:@")
35183519
global or local to window |global-local|
35193520
Characters to fill the statuslines, vertical separators and special
35203521
lines in the window.
@@ -3552,50 +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-
If a match is found, the expression should return a |List| containing
3571-
one or more file names. If a match is not found, the expression
3574+
The function is called only once per |:find| command invocation.
3575+
The function can process all the directories specified in 'path'.
3576+
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
35723579
should return an empty List.
35733580

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

3577-
Using a function call without arguments is faster |expr-option-function|
3578-
35793584
It is not allowed to change text or jump to another window while
3580-
evaluating 'findexpr' |textlock|.
3585+
executing the 'findfunc' |textlock|.
35813586

35823587
This option cannot be set from a |modeline| or in the |sandbox|, for
35833588
security reasons.
35843589

35853590
Examples:
35863591
>
35873592
" Use glob()
3588-
func FindExprGlob()
3589-
return glob(v:fname, v:false, v:true)
3593+
func FindFuncGlob(cmdarg, cmdcomplete)
3594+
let pat = a:cmdcomplete ? $'{a:cmdarg}*' : a:cmdarg
3595+
return glob(pat, v:false, v:true)
35903596
endfunc
3591-
set findexpr=FindExprGlob()
3597+
set findfunc=FindFuncGlob
35923598
35933599
" Use the 'git ls-files' output
3594-
func FindGitFiles()
3600+
func FindGitFiles(cmdarg, cmdcomplete)
35953601
let fnames = systemlist('git ls-files')
3596-
return fnames->filter('v:val =~? v:fname')
3602+
return fnames->filter('v:val =~? a:cmdarg')
35973603
endfunc
3598-
set findexpr=FindGitFiles()
3604+
set findfunc=FindGitFiles
35993605
<
36003606
*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
36013607
'fixendofline' 'fixeol' boolean (default on)

0 commit comments

Comments
 (0)