Skip to content

Commit 5ccf48c

Browse files
committed
Update diff.{txt,jax}
1 parent 5e62ac4 commit 5ccf48c

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

doc/diff.jax

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
2つ目以降の引数にはディレクトリ名を指定することもできる。その際には第1引数の
3939
ファイル名がそのディレクトリ名に追加され、ファイルを検索するのに利用される。
4040

41-
これは外部コマンドの "diff" が存在する場合にだけ動作する。'diffexpr' 参照。
41+
デフォルトでは、内部diffライブラリが使用される。'diffopt' または'diffexpr'
42+
設定されていると外部の "diff" コマンドが使用される。これは、そのようなdiffプロ
43+
グラムが利用可能な場合にのみ機能する。
4244

4345
diff はカレントタブページ |tab-page| にローカルである。他のタブページにある
4446
ウィンドウとの差分を見ることはできない。これによって、複数の差分を同時に見るこ
@@ -340,8 +342,9 @@ g:diff_translations を 0 に設定する: >
340342
341343
">" は 'shellredir' の値に置き換えられる。
342344

343-
"diff" の出力は通常の "ed" 形式の差分でなければならない。コンテキスト差分を使
344-
用してはいけない。この例はVimが求めるフォーマットを示している: >
345+
"diff" の出力は通常の "ed" 形式の差分またはユニファイド差分でなければならない。
346+
コンテキスト差分を使用してはいけない。 この例では、Vimが "ed" 形式の差分に求め
347+
るフォーマットを示している: >
345348
346349
1a2
347350
> bbb
@@ -379,12 +382,16 @@ g:diff_translations を 0 に設定する: >
379382
endif
380383
silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new .
381384
\ " > " . v:fname_out
385+
redraw!
382386
endfunction
383387
384388
引数の "-a" は強制的にテキストファイルとして比較するために使われる。バイナリで
385389
の比較は使いにくい。引数の "--binary" はファイルをバイナリモードで読み込むため
386390
に使われる。DOSでCTRL-Zをテキストの終わりとしないためである。
387391

392+
シェルコマンドを実行し、ディスプレイに何かが表示されるかどうかによっては、
393+
`redraw!` コマンドは必要ないかもしれない。
394+
388395
*E810* *E97*
389396
Vimは差分の出力結果が妥当であるか検証する。妥当でない場合、エラーメッセージを
390397
得るだろう。起こりうるエラーは:

en/diff.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ The second and following arguments may also be a directory name. Vim will
3939
then append the file name of the first argument to the directory name to find
4040
the file.
4141

42-
This only works when a standard "diff" command is available. See 'diffexpr'.
42+
By default an internal diff library will be used. When 'diffopt' or
43+
'diffexpr' has been set an external "diff" command will be used. This only
44+
works when such a diff program is available.
4345

4446
Diffs are local to the current tab page |tab-page|. You can't see diffs with
4547
a window in another tab page. This does make it possible to have several
@@ -344,8 +346,9 @@ between file1 and file2: >
344346
345347
The ">" is replaced with the value of 'shellredir'.
346348

347-
The output of "diff" must be a normal "ed" style diff. Do NOT use a context
348-
diff. This example explains the format that Vim expects: >
349+
The output of "diff" must be a normal "ed" style diff or a unified diff. Do
350+
NOT use a context diff. This example explains the format that Vim expects for
351+
the "ed" style diff: >
349352
350353
1a2
351354
> bbb
@@ -384,12 +387,16 @@ Example (this does almost the same as 'diffexpr' being empty): >
384387
endif
385388
silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new .
386389
\ " > " . v:fname_out
390+
redraw!
387391
endfunction
388392
389393
The "-a" argument is used to force comparing the files as text, comparing as
390394
binaries isn't useful. The "--binary" argument makes the files read in binary
391395
mode, so that a CTRL-Z doesn't end the text on DOS.
392396

397+
The `redraw!` command may not be needed, depending on whether executing a
398+
shell command shows something on the display or not.
399+
393400
*E810* *E97*
394401
Vim will do a test if the diff output looks alright. If it doesn't, you will
395402
get an error message. Possible causes:

0 commit comments

Comments
 (0)