summaryrefslogtreecommitdiffstats
path: root/runtime/doc
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2024-02-12 20:21:26 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-12 20:24:56 +0100
commita0010a186d93187d2b69b857d75db8a1e01049bb (patch)
tree5ec733566b066d5d053a38fe2117ac5bad68e6ad /runtime/doc
parent6d91227267a5f7e21fc9b30443687618e92751bf (diff)
patch 9.1.0099: Not able to use diff() with 'diffexpr'v9.1.0099
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>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/builtin.txt9
-rw-r--r--runtime/doc/diff.txt7
2 files changed, 12 insertions, 4 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 0dca4679e9..0b3d59e966 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.1. Last change: 2024 Feb 11
+*builtin.txt* For Vim version 9.1. Last change: 2024 Feb 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2078,8 +2078,7 @@ diff({fromlist}, {tolist} [, {options}]) *diff()*
use. Supported boolean items are
"myers", "minimal", "patience" and
"histogram".
- context unified diff context length. Default
- is 1.
+ context diff context length. Default is 0.
iblank ignore changes where lines are all
blank.
icase ignore changes in case of text.
@@ -2092,6 +2091,10 @@ diff({fromlist}, {tolist} [, {options}]) *diff()*
line.
For more information about these options, refer to 'diffopt'.
+ To compute the unified diff, all the items in {fromlist} are
+ concatenated into a string using a newline separator and the
+ same for {tolist}. The unified diff output uses line numbers.
+
Returns an empty List or String if {fromlist} and {tolist} are
identical.
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 05dd4a6be9..e3abbdeff5 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -510,9 +510,14 @@ between two Lists of strings are below.
[{'from_idx': 1, 'from_count': 2, 'to_idx': 1, 'to_count': 0}]
" disjointed changes
- :echo diff(['ab', 'def', 'ghi', 'jkl'], ['abc', 'def', 'ghi', 'jk'], {'output': 'indices'})
+ :echo diff(['ab', 'def', 'ghi', 'jkl'], ['abc', 'def', 'ghi', 'jk'], {'output': 'indices', 'context': 0})
[{'from_idx': 0, 'from_count': 1, 'to_idx': 0, 'to_count': 1},
{'from_idx': 3, 'from_count': 1, 'to_idx': 3, 'to_count': 1}]
+
+ " disjointed changes with context length 1
+ :echo diff(['ab', 'def', 'ghi', 'jkl'], ['abc', 'def', 'ghi', 'jk'], {'output': 'indices', 'context': 1})
+ [{'from_idx': 0, 'from_count': 4, 'to_idx': 0, 'to_count': 4}]
+
<
vim:tw=78:ts=8:noet:ft=help:norl: