-*options.txt* For Vim version 9.1. Last change: 2025 Nov 27
+*options.txt* For Vim version 9.1. Last change: 2025 Dec 09
VIM REFERENCE MANUAL by Bram Moolenaar
internal Use the internal diff library. This is
ignored when 'diffexpr' is set. *E960*
When running out of memory when writing a
- buffer this item will be ignored for diffs
- involving that buffer. Set the 'verbose'
- option to see when this happens.
+ buffer or the diff is larger than 1 GB this
+ item will be ignored for diffs involving that
+ buffer. Set the 'verbose' option to see when
+ this happens.
iwhite Ignore changes in amount of white space. Adds
the "-b" flag to the "diff" command if
#define LBUFLEN 50 // length of line in diff file
+// Max file size xdiff is eqipped to deal with. The value (1GB - 1MB) comes
+// from Git's implementation.
+#define MAX_XDIFF_SIZE (1024L * 1024 * 1023)
+
static int diff_a_works = MAYBE; // TRUE when "diff -a" works, FALSE when it
// doesn't work, MAYBE when not checked yet
#if defined(MSWIN)
emit_cfg.hunk_func = xdiff_out_indices;
else
emit_cb.out_line = xdiff_out_unified;
+ if (diffio->dio_orig.din_mmfile.size > MAX_XDIFF_SIZE ||
+ diffio->dio_new.din_mmfile.size > MAX_XDIFF_SIZE)
+ {
+ emsg(_(e_problem_creating_internal_diff));
+ return FAIL;
+ }
if (xdl_diff(&diffio->dio_orig.din_mmfile,
&diffio->dio_new.din_mmfile,
¶m, &emit_cfg, &emit_cb) < 0)