import { term_dumpdiff } from "https://deno.land/x/denops_std@v6.5.0/function/vim/mod.ts";
Open a new window displaying the difference between the two
files. The files must have been created with
term_dumpwrite()
.
Returns the buffer number or zero when the diff fails.
Also see terminal-diff
.
NOTE: this does not work with double-width characters yet.
The top part of the buffer contains the contents of the first file, the bottom part of the buffer contains the contents of the second file. The middle part shows the differences. The parts are separated by a line of equals.
If the {options} argument is present, it must be a Dict with
these possible members:
"term_name" name to use for the buffer name, instead
of the first file name.
"term_rows" vertical size to use for the terminal,
instead of using 'termwinsize', but
respecting the minimal size
"term_cols" horizontal size to use for the terminal,
instead of using 'termwinsize', but
respecting the minimal size
"vertical" split the window vertically
"curwin" use the current window, do not split the
window; fails if the current buffer
cannot be abandon
ed
"bufnr" do not create a new buffer, use the
existing buffer "bufnr". This buffer
must have been previously created with
term_dumpdiff() or term_dumpload() and
visible in a window.
"norestore" do not add the terminal window to a
session file
Each character in the middle part indicates a difference. If there are multiple differences only the first in this list is used: X different character w different width f different foreground color b different background color a different attribute + missing position in first file - missing position in second file > cursor position in first file, not in second < cursor position in second file, not in first
Using the "s" key the top and bottom parts are swapped. This makes it easy to spot a difference.
Can also be used as a method
:
GetFilename()->term_dumpdiff(otherfile)