patch 9.1.0099: Not able to use diff() with 'diffexpr'
Problem: Not able to use diff() with 'diffexpr'
(rickhowe, after v9.1.0096)
Solution: Use a default context length of 0, update diff() help text,
add a test for using diff() with 'diffexpr'
(Yegappan Lakshmanan)
closes: #14013
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/diff.c b/src/diff.c
index a4f3f7e..d2089dc 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -3511,9 +3511,9 @@
}
}
- *diff_ctxlen = dict_get_number_def(d, "context", 1);
+ *diff_ctxlen = dict_get_number_def(d, "context", 0);
if (*diff_ctxlen < 0)
- *diff_ctxlen = 1;
+ *diff_ctxlen = 0;
if (dict_get_bool(d, "iblank", FALSE))
*diffopts |= DIFF_IBLANK;
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 67a1427..d13eb1c 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1952,7 +1952,7 @@
{"did_filetype", 0, 0, 0, NULL,
ret_number_bool, f_did_filetype},
{"diff", 2, 3, FEARG_1, arg3_diff,
- ret_list_dict_any, f_diff},
+ ret_any, f_diff},
{"diff_filler", 1, 1, FEARG_1, arg1_lnum,
ret_number, f_diff_filler},
{"diff_hlID", 2, 2, FEARG_1, arg2_lnum_number,
diff --git a/src/testdir/dumps/Test_difffunc_diffexpr_1.dump b/src/testdir/dumps/Test_difffunc_diffexpr_1.dump
new file mode 100644
index 0000000..b103cc8
--- /dev/null
+++ b/src/testdir/dumps/Test_difffunc_diffexpr_1.dump
@@ -0,0 +1,12 @@
+| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34||+1#0000000#ffffff0| +0#0000e05#a8a8a8255@1|z+0#0000000#5fd7ff255|e|r|o| @30
+| +0#0000e05#a8a8a8255@1>o+0#0000000#ffffff0|n|e| @31||+1&&| +0#0000e05#a8a8a8255@1|o+0#0000000#ffffff0|n|e| @31
+| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|w|o|x+2&#ff404010| +0&#ffd7ff255@30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|t+0#0000000#ffd7ff255|w|o| @31
+| +0#0000e05#a8a8a8255@1|t+0#0000000#ffffff0|h|r|e@1| @29||+1&&| +0#0000e05#a8a8a8255@1|t+0#0000000#ffffff0|h|r|e@1| @29
+| +0#0000e05#a8a8a8255@1|f+0#0000000#5fd7ff255|o|u|r| @30||+1&#ffffff0| +0#0000e05#a8a8a8255@1|-+0#4040ff13#afffff255@34
+|~+0&#ffffff0| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|X+3#0000000&|d|i|f@2|u|n|c|2|.|t|x|t| @4|1|,|1| @11|A|l@1| |X+1&&|d|i|f@2|u|n|c|1|.|t|x|t| @4|1|,|1| @11|A|l@1
+|"+0&&|X|d|i|f@2|u|n|c|2|.|t|x|t|"| |4|L|,| |2|0|B| @50
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index d37a9a2..8e7d5ce 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
Binary files differ
diff --git a/src/version.c b/src/version.c
index 7fd6982..7a9172a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 99,
+/**/
98,
/**/
97,