diff options
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/diff.txt | 31 | ||||
-rw-r--r-- | runtime/doc/news.txt | 4 | ||||
-rw-r--r-- | runtime/doc/options.txt | 17 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 5 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 2 |
5 files changed, 46 insertions, 13 deletions
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index c9de54342e..2c2565985a 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -214,14 +214,29 @@ The diffs are highlighted with these groups: |hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in this buffer but not in another. |hl-DiffChange| DiffChange Changed lines. -|hl-DiffText| DiffText Changed text inside a Changed line. Vim - finds the first character that is different, - and the last character that is different - (searching from the end of the line). The - text in between is highlighted. This means - that parts in the middle that are still the - same are highlighted anyway. The 'diffopt' - flags "iwhite" and "icase" are used here. +|hl-DiffText| DiffText Changed text inside a Changed line. Exact + behavior depends on the `inline:` setting in + 'diffopt'. + With `inline:` set to "simple", Vim finds the + first character that is different, and the + last character that is different (searching + from the end of the line). The text in + between is highlighted. This means that parts + in the middle that are still the same are + highlighted anyway. The 'diffopt' flags + "iwhite" and "icase" are used here. + With `inline:` set to "char" or "word", Vim + uses the internal diff library to perform a + detailed diff between the changed blocks and + highlight the exact difference between the + two. Will respect any 'diffopt' flag that + affects internal diff. + Not used when `inline:` set to "none". +|hl-DiffTextAdd| DiffTextAdd Added text inside a Changed line. Similar to + DiffText, but used when there is no + corresponding text in other buffers. Will not + be used when `inline:` is set to "simple" or + "none". |hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines, because they don't really exist in this buffer. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index ad1481e304..aa6af1ef55 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -66,7 +66,7 @@ EVENTS HIGHLIGHTS -• todo +• |hl-DiffTextAdd| highlights added text within a changed line. LSP @@ -78,7 +78,7 @@ LUA OPTIONS -• todo +• 'diffopt' `inline:` configures diff highlighting for changes within a line. PLUGINS diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index dd2460722e..09eeddb0f7 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2056,7 +2056,7 @@ A jump table for the options with a short description can be found at |Q_op|. security reasons. *'diffopt'* *'dip'* -'diffopt' 'dip' string (default "internal,filler,closeoff,linematch:40") +'diffopt' 'dip' string (default "internal,filler,closeoff,inline:simple,linematch:40") global Option settings for diff mode. It can consist of the following items. All are optional. Items must be separated by a comma. @@ -2119,6 +2119,21 @@ A jump table for the options with a short description can be found at |Q_op|. Use the indent heuristic for the internal diff library. + inline:{text} Highlight inline differences within a change. + See |view-diffs|. Supported values are: + + none Do not perform inline highlighting. + simple Highlight from first different + character to the last one in each + line. This is the default if nothing + is set. + char Use internal diff to perform a + character-wise diff and highlight the + difference. + word Use internal diff to perform a + |word|-wise diff and highlight the + difference. + internal Use the internal diff library. This is ignored when 'diffexpr' is set. *E960* When running out of memory when writing a diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index faca3d88da..d44e3cea8e 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -5177,8 +5177,11 @@ DiffChange Diff mode: Changed line. |diff.txt| DiffDelete Diff mode: Deleted line. |diff.txt| *hl-DiffText* DiffText Diff mode: Changed text within a changed line. |diff.txt| + *hl-DiffTextAdd* +DiffTextAdd Diff mode: Added text within a changed line. Linked to + |hl-DiffText| by default. |diff.txt| *hl-EndOfBuffer* -EndOfBuffer Filler lines (~) after the end of the buffer. +EndOfBuffer Filler lines (~) after the last line in the buffer. By default, this is highlighted like |hl-NonText|. *hl-TermCursor* TermCursor Cursor in a focused terminal. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index df79d25198..a5c72363b4 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -48,7 +48,7 @@ Defaults *defaults* *nvim-defaults* - 'complete' excludes "i" - 'completeopt' defaults to "menu,popup" - 'define' defaults to "". The C ftplugin sets it to "^\\s*#\\s*define" -- 'diffopt' defaults to "internal,filler,closeoff,linematch:40" +- 'diffopt' defaults to "internal,filler,closeoff,inline:simple,linematch:40" - 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created - 'display' defaults to "lastline" - 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding) |