Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions doc/diff.jax
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

削除された行は画面に表示こそされているが、テキストラインとしては数えられていな
いことに注意。消された範囲にカーソルを移動することはできない。もう一方のバッ
Expand Down
22 changes: 12 additions & 10 deletions en/diff.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down