From be70012983a712ce0e6c1ede25fd8741d941a5f1 Mon Sep 17 00:00:00 2001 From: h-east Date: Sun, 6 Apr 2025 22:23:47 +0900 Subject: [PATCH] Update autocmd.{txt,jax} --- doc/autocmd.jax | 21 +++++++++++++++------ en/autocmd.txt | 16 ++++++++++++---- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/doc/autocmd.jax b/doc/autocmd.jax index dae0508fd..3fdc87c85 100644 --- a/doc/autocmd.jax +++ b/doc/autocmd.jax @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim バージョン 9.1. Last change: 2025 Mar 12 +*autocmd.txt* For Vim バージョン 9.1. Last change: 2025 Apr 04 VIMリファレンスマニュアル by Bram Moolenaar @@ -596,9 +596,10 @@ BufWriteCmd バッファ全体をファイルに書き込む前。ファイル の書き込みの役目を負い、成功したときはオプショ ン 'modified' をオフにする。バッファの内容を変 更すべきではない。 - 'modified' をオフにすると、以前の undo 状態が - 'modified' (変更あり) になるように undo 情報が - 調整される (|:write| と同様)。 + コマンドが 'modified' をリセットすると、 + |:write| と同様に、古い undo 状態を'modified' + としてマークするように undo 情報が調整される。 + 行の範囲には |'[| と |']| マークを使用する。 |Cmd-event| *BufWritePost* BufWritePost バッファ全体をファイルに書き込んだ後 (イベント @@ -882,13 +883,15 @@ FileType オプション 'filetype' が設定されたとき。 *FileWriteCmd* FileWriteCmd バッファ全体を書き込まない場合の、ファイルに書 き込む前。ファイルへの書き込みの役目を負う。バッ - ファを変更すべきではない。 |Cmd-event| + ファを変更すべきではない。行の範囲には |'[| と + |']| マークを使用する。 |Cmd-event| *FileWritePost* FileWritePost バッファ全体を書き込まない場合の、ファイルに書 き込んだ後。 *FileWritePre* FileWritePre バッファ全体を書き込まない場合の、ファイルに書 - き込む前。 + き込む前。行の範囲には |'[| と |']| マークを使 + 用する。 *FilterReadPost* FilterReadPost フィルタコマンドからファイルを読み込んだ後。 Vimは FilterReadPre と同様に、現在のバッファの @@ -1457,6 +1460,12 @@ WinScrolled カレントのタブページのウィンドウでテキストが さが変更された後。|win-scrolled-resized| を参 照。 + Note: これは、Vim がメインループに戻ったときに + 通常のコマンドを処理した後でトリガーされるた + め、`:noautocmd` ではスキップできない。これを + 無効にしたい場合は、代わりに 'eventignore' オ + プションを設定することを検討すること。 + パターンは、スクロールかリサイズされた最初の ウィンドウの |window-ID| に対してマッチングさ れる。 両方が |window-ID| diff --git a/en/autocmd.txt b/en/autocmd.txt index 372d1acbc..b9b76ffce 100644 --- a/en/autocmd.txt +++ b/en/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2025 Mar 12 +*autocmd.txt* For Vim version 9.1. Last change: 2025 Apr 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -593,7 +593,8 @@ BufWriteCmd Before writing the whole buffer to a file. The buffer contents should not be changed. When the command resets 'modified' the undo information is adjusted to mark older undo - states as 'modified', like |:write| does. + states as 'modified', like |:write| does. Use + the |'[| and |']| marks for the range of lines. |Cmd-event| *BufWritePost* BufWritePost After writing the whole buffer to a file @@ -886,14 +887,14 @@ FileType When the 'filetype' option has been set. The FileWriteCmd Before writing to a file, when not writing the whole buffer. Should do the writing to the file. Should not change the buffer. Use the - '[ and '] marks for the range of lines. + |'[| and |']| marks for the range of lines. |Cmd-event| *FileWritePost* FileWritePost After writing to a file, when not writing the whole buffer. *FileWritePre* FileWritePre Before writing to a file, when not writing the - whole buffer. Use the '[ and '] marks for the + whole buffer. Use the |'[| and |']| marks for the range of lines. *FilterReadPost* FilterReadPost After reading a file from a filter command. @@ -1480,6 +1481,13 @@ WinScrolled After any window in the current tab page or changed width or height. See |win-scrolled-resized|. + Note: This can not be skipped with + `:noautocmd`, because it triggers after + processing normal commands when Vim is back in + the main loop. If you want to disable this, + consider setting the 'eventignore' option + instead. + The pattern is matched against the |window-ID| of the first window that scrolled or resized. Both and are set to the