diff options
Diffstat (limited to 'runtime/doc/diff.txt')
-rw-r--r-- | runtime/doc/diff.txt | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 6115a5d235..9c5792dd43 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -324,8 +324,9 @@ After setting this variable, reload the syntax script: > FINDING THE DIFFERENCES *diff-diffexpr* -The 'diffexpr' option can be set to use something else than the standard -"diff" program to compare two files and find the differences. *E959* +The 'diffexpr' option can be set to use something else than the internal diff +support or the standard "diff" program to compare two files and find the +differences. When 'diffexpr' is empty, Vim uses this command to find the differences between file1 and file2: > @@ -358,7 +359,7 @@ format mentioned. These variables are set to the file names used: v:fname_in original file v:fname_new new version of the same file - v:fname_out resulting diff file + v:fname_out where to write the resulting diff file Additionally, 'diffexpr' should take care of "icase" and "iwhite" in the 'diffopt' option. 'diffexpr' cannot change the value of 'lines' and @@ -370,13 +371,13 @@ Example (this does almost the same as 'diffexpr' being empty): > function MyDiff() let opt = "" if &diffopt =~ "icase" - let opt = opt . "-i " + let opt = opt .. "-i " endif if &diffopt =~ "iwhite" - let opt = opt . "-b " + let opt = opt .. "-b " endif - silent execute "!diff -a --binary " . opt . v:fname_in . " " . v:fname_new . - \ " > " . v:fname_out + silent execute "!diff -a --binary " .. opt .. v:fname_in .. " " .. v:fname_new .. + \ " > " .. v:fname_out redraw! endfunction @@ -426,8 +427,8 @@ Example (this does the same as 'patchexpr' being empty): > set patchexpr=MyPatch() function MyPatch() - :call system("patch -o " . v:fname_out . " " . v:fname_in . - \ " < " . v:fname_diff) + :call system("patch -o " .. v:fname_out .. " " .. v:fname_in .. + \ " < " .. v:fname_diff) endfunction Make sure that using the "patch" program doesn't have unwanted side effects. |