From 198bf72424eddf0845d175b2b1472f2290e6ba37 Mon Sep 17 00:00:00 2001 From: h-east Date: Thu, 1 May 2025 13:10:57 +0900 Subject: [PATCH] Update tagsrch.{txt,jax} --- doc/tagsrch.jax | 23 ++++++++++++----------- en/tagsrch.txt | 23 ++++++++++++----------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/doc/tagsrch.jax b/doc/tagsrch.jax index e5e9798ce..867390ac0 100644 --- a/doc/tagsrch.jax +++ b/doc/tagsrch.jax @@ -1,4 +1,4 @@ -*tagsrch.txt* For Vim バージョン 9.1. Last change: 2025 Apr 26 +*tagsrch.txt* For Vim バージョン 9.1. Last change: 2025 Apr 30 VIMリファレンスマニュアル by Bram Moolenaar @@ -885,8 +885,9 @@ CTRL-W d 新しいウィンドウを開き、カーソルの下にあったキ ============================================================================== 7. 'tagfunc' を使う *tag-function* -|:tag|、|:tselect| のようなコマンド、および |CTRL-]| のようなノーマルモードタ -グコマンドに使われるタグのリストを生成する関数をVimに提供することが可能である。 +|:tag|、|:tselect| のようなコマンド、|CTRL-]| のようなノーマルモードのタグコマ +ンド、および |taglist()| 関数に使用されるタグのリストを生成する関数を Vim に提 +供することができる。 タグリストの生成に使用される関数は、'tagfunc' オプションを設定することによって 指定される。関数は3つの引数で呼び出される: @@ -938,15 +939,14 @@ Note フォーマットは |taglist()| のものと似ており、これによ 以下は、'tagfunc' に使用される関数の仮定の例である。結果(ファイル名の逆順のタ グのリスト)を生成するために |taglist()| の出力を使用している。 -> - function TagFunc(pattern, flags, info) - function CompareFilenames(item1, item2) - let f1 = a:item1['filename'] - let f2 = a:item2['filename'] - return f1 >=# f2 ? - \ -1 : f1 <=# f2 ? 1 : 0 - endfunction +>vim + function CompareFilenames(item1, item2) + let f1 = a:item1['filename'] + let f2 = a:item2['filename'] + return f1 >=# f2 ? -1 : f1 <=# f2 ? 1 : 0 + endfunction + function TagFunc(pattern, flags, info) let result = taglist(a:pattern) call sort(result, "CompareFilenames") @@ -954,5 +954,6 @@ Note フォーマットは |taglist()| のものと似ており、これによ endfunc set tagfunc=TagFunc < +Note: |taglist()| を実行すると、'tagfunc' 関数は再帰的に呼び出されない。 vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/en/tagsrch.txt b/en/tagsrch.txt index 132414368..e6bfe1785 100644 --- a/en/tagsrch.txt +++ b/en/tagsrch.txt @@ -1,4 +1,4 @@ -*tagsrch.txt* For Vim version 9.1. Last change: 2025 Apr 26 +*tagsrch.txt* For Vim version 9.1. Last change: 2025 Apr 30 VIM REFERENCE MANUAL by Bram Moolenaar @@ -894,8 +894,8 @@ Common arguments for the commands above: 7. Using 'tagfunc' *tag-function* It is possible to provide Vim with a function which will generate a list of -tags used for commands like |:tag|, |:tselect| and Normal mode tag commands -like |CTRL-]|. +tags used for commands like |:tag|, |:tselect|, Normal mode tag commands like +|CTRL-]| and for the |taglist()| function. The function used for generating the taglist is specified by setting the 'tagfunc' option. The function will be called with three arguments: @@ -950,15 +950,14 @@ It is not allowed to close a window or change window from inside 'tagfunc'. The following is a hypothetical example of a function used for 'tagfunc'. It uses the output of |taglist()| to generate the result: a list of tags in the inverse order of file names. -> - function TagFunc(pattern, flags, info) - function CompareFilenames(item1, item2) - let f1 = a:item1['filename'] - let f2 = a:item2['filename'] - return f1 >=# f2 ? - \ -1 : f1 <=# f2 ? 1 : 0 - endfunction +>vim + function CompareFilenames(item1, item2) + let f1 = a:item1['filename'] + let f2 = a:item2['filename'] + return f1 >=# f2 ? -1 : f1 <=# f2 ? 1 : 0 + endfunction + function TagFunc(pattern, flags, info) let result = taglist(a:pattern) call sort(result, "CompareFilenames") @@ -966,5 +965,7 @@ inverse order of file names. endfunc set tagfunc=TagFunc < +Note: When executing |taglist()| the 'tagfunc' function won't be called +recursively. vim:tw=78:ts=8:noet:ft=help:norl: