diff --git a/doc/diff.jax b/doc/diff.jax index 8f2ee6b0c..7cc599491 100644 --- a/doc/diff.jax +++ b/doc/diff.jax @@ -1,4 +1,4 @@ -*diff.txt* For Vim バージョン 9.1. Last change: 2025 Mar 28 +*diff.txt* For Vim バージョン 9.1. Last change: 2025 Jun 20 VIMリファレンスマニュアル by Bram Moolenaar @@ -310,18 +310,20 @@ Vimは片方のウィンドウには存在しないがもう一方には存在 として用いられる。 -[range]が与えられない場合にはカーソルの位置かその上の差分が適用される。[range] -が使われた時にはその範囲だけを適用(put/get)しようと試みる。削除された場合には -必ずしも可能なわけではない。 +[range] が指定されていない場合、カーソル位置またはそのすぐ上の差分が影響を受け +る。バッファの最終行の下に削除された行がある場合がある。カーソルがバッファの最 +終行にあり、その行より上に差分がなく、[range] が指定されていない場合は、カーソ +ル位置より下の差分が代わりに使用される。 -バッファの最後の行のさらに下方に削除された行があることも考えられる。そのとき -カーソルが最終行にあり、最終行より上に差異がないとき、":diffget" と "do" コマ -ンドはそれらの行を取得する。 +[range] を使用すると、Vim は指定された行のみを put または get しようとする。削 +除された行がある場合、それらの行が [range] で指定された行の間にある場合にのみ +使用される。 -超えた位置の行をもう一方のバッファから取得するには、最終行+1の行番号を指定す -る。次のコマンドはもう一方のバッファから完全な差分情報を受け取る: > +[range] 内の行を別のバッファに送ったり、別のバッファから取得したりするには、0 +と最終行番号に 1 を加えた値を使用できる。このコマンドは、他のバッファからすべ +ての差分を取得する: > - :1,$+1diffget + :0,$+1diffget 削除された行は画面に表示こそされているが、テキストラインとしては数えられていな いことに注意。消された範囲にカーソルを移動することはできない。もう一方のバッ diff --git a/en/diff.txt b/en/diff.txt index 81564664e..493c740ad 100644 --- a/en/diff.txt +++ b/en/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 9.1. Last change: 2025 Mar 28 +*diff.txt* For Vim version 9.1. Last change: 2025 Jun 20 VIM REFERENCE MANUAL by Bram Moolenaar @@ -304,18 +304,20 @@ that the buffers will be equal within the specified range. When no [range] is given, the diff at the cursor position or just above it is -affected. When [range] is used, Vim tries to only put or get the specified -lines. When there are deleted lines, this may not always be possible. +affected. There can be deleted lines below the last line of the buffer. When +the cursor is on the last line in the buffer and there is no diff above this +line, and no [range] is given, the diff below the cursor position will be used +instead. -There can be deleted lines below the last line of the buffer. When the cursor -is on the last line in the buffer and there is no diff above this line, the -":diffget" and "do" commands will obtain lines from the other buffer. +When [range] is used, Vim tries to only put or get the specified lines. When +there are deleted lines, they will be used if they are between the lines +specified by [range]. -To be able to get those lines from another buffer in a [range] it's allowed to -use the last line number plus one. This command gets all diffs from the other -buffer: > +To be able to put or get those lines to/from another buffer in a [range] it's +allowed to use 0 and the last line number plus one. This command gets all +diffs from the other buffer: > - :1,$+1diffget + :0,$+1diffget Note that deleted lines are displayed, but not counted as text lines. You can't move the cursor into them. To fill the deleted lines with the lines