diff --git a/doc/autocmd.jax b/doc/autocmd.jax index c1b4d97ab..1901361e3 100644 --- a/doc/autocmd.jax +++ b/doc/autocmd.jax @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim バージョン 9.1. Last change: 2025 Feb 08 +*autocmd.txt* For Vim バージョン 9.1. Last change: 2025 Mar 08 VIMリファレンスマニュアル by Bram Moolenaar @@ -609,6 +609,8 @@ CmdUndefined ユーザー定義コマンドが使われたが、定義され のに便利である。パターンはコマンド名に対して照 合される。 の両方ともコマン ド名に設定される。 + これは、|autocmd-nested| なしで定義された自動 + コマンドの内部でもトリガーされる。 NOTE: 未定義のコマンドに対して自動補完は機能し ない。このイベントを使う代わりにユーザー定義コ マンドを常に定義するようにしてそのコマンドから @@ -925,7 +927,9 @@ FuncUndefined ユーザー定義関数が使われたが、定義されてい ある。パターンは関数名に対して照合される。 の両方とも関数名に設定され る。 - コンパイルされた |Vim9| 関数では発生しない。 + これは、|autocmd-nested| なしで定義された自動 + コマンド内でもトリガーされるが、|Vim9| 関数を + コンパイルするときにはトリガーされない。 NOTE: Vim script を書くときには autoload 関数 を使う方がよい。 |autoload-functions|を参照。 diff --git a/en/autocmd.txt b/en/autocmd.txt index a8f1b8b1a..5c449589d 100644 --- a/en/autocmd.txt +++ b/en/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2025 Feb 08 +*autocmd.txt* For Vim version 9.1. Last change: 2025 Mar 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -603,6 +603,8 @@ CmdUndefined When a user command is used but it isn't when it's used. The pattern is matched against the command name. Both and are set to the name of the command. + This is triggered even when inside an + autocommand defined without |autocmd-nested|. NOTE: Autocompletion won't work until the command is defined. An alternative is to always define the user command and have it @@ -934,7 +936,9 @@ FuncUndefined When a user function is used but it isn't when it's used. The pattern is matched against the function name. Both and are set to the name of the function. - Not triggered when compiling a |Vim9| + This is triggered even when inside an + autocommand defined without |autocmd-nested|, + but not triggered when compiling a |Vim9| function. NOTE: When writing Vim scripts a better alternative is to use an autoloaded function.