diff options
author | Siddhant Agarwal <68201519+siddhantdev@users.noreply.github.com> | 2025-02-06 17:47:36 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-06 04:17:36 -0800 |
commit | 6db830e40e92dd61cd62d3e0bb5296e8b600cc18 (patch) | |
tree | 051e5cf975524ef020ed873f086e1e4bef94dd16 | |
parent | 878b3b89c316138d99f9dbc47c84f2f94591df03 (diff) | |
download | rneovim-6db830e40e92dd61cd62d3e0bb5296e8b600cc18.tar.gz rneovim-6db830e40e92dd61cd62d3e0bb5296e8b600cc18.tar.bz2 rneovim-6db830e40e92dd61cd62d3e0bb5296e8b600cc18.zip |
feat(defaults): enable diffopt "linematch" #32346
-rw-r--r-- | runtime/doc/news.txt | 1 | ||||
-rw-r--r-- | runtime/doc/options.txt | 2 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/options.lua | 2 | ||||
-rw-r--r-- | src/nvim/options.lua | 2 | ||||
-rw-r--r-- | test/functional/legacy/scroll_opt_spec.lua | 4 | ||||
-rw-r--r-- | test/old/testdir/setup.vim | 1 |
6 files changed, 7 insertions, 5 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 12fac28db8..bfa98dce05 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -72,6 +72,7 @@ DEFAULTS • 'number', 'relativenumber', 'signcolumn', and 'foldcolumn' are disabled in |terminal| buffers. See |terminal-config| for an example of changing these defaults. +• 'diffopt' default includes "linematch:40". DIAGNOSTICS diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 4d186bd761..550d3cbb14 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -2032,7 +2032,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") +'diffopt' 'dip' string (default "internal,filler,closeoff,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. diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua index 52c556867f..9bf183a1c1 100644 --- a/runtime/lua/vim/_meta/options.lua +++ b/runtime/lua/vim/_meta/options.lua @@ -1739,7 +1739,7 @@ vim.go.dex = vim.go.diffexpr --- --- --- @type string -vim.o.diffopt = "internal,filler,closeoff" +vim.o.diffopt = "internal,filler,closeoff,linematch:40" vim.o.dip = vim.o.diffopt vim.go.diffopt = vim.o.diffopt vim.go.dip = vim.go.diffopt diff --git a/src/nvim/options.lua b/src/nvim/options.lua index c61c6032c4..99ac9d61ad 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2152,7 +2152,7 @@ local options = { { abbreviation = 'dip', cb = 'did_set_diffopt', - defaults = 'internal,filler,closeoff', + defaults = 'internal,filler,closeoff,linematch:40', -- Keep this in sync with diffopt_changed(). values = { 'filler', diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index a92b95731e..7c97127193 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -438,8 +438,8 @@ describe('smoothscroll', function() {7: }bc abc abc abc abc abc ab│{7: }bc abc abc abc abc abc ab| {7: }c abc abc abc abc abc abc│{7: }c abc abc abc abc abc abc| {7: } abc abc abc abc abc │{7: } abc abc abc abc abc | - {7: }{27:foo}{4: }│{7: }{27:barba^r}{4: }| - {7: }{22:bar }│{7: }{23:-------------------------}| + {7: }{22:foo }│{7: }{23:-------------------------}| + {7: }{4:bar }│{7: }{4:bar}{27:ba^r}{4: }| {7: } abc abc abc abc abc abc │{7: } abc abc abc abc abc abc | {7: }abc abc abc abc abc abc a│{7: }abc abc abc abc abc abc a| {7: }bc abc abc abc abc abc ab│{7: }bc abc abc abc abc abc ab| diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim index 61596fc83a..9bb2dd4e0a 100644 --- a/test/old/testdir/setup.vim +++ b/test/old/testdir/setup.vim @@ -4,6 +4,7 @@ if exists('s:did_load') set complete=.,w,b,u,t,i set define=^\\s*#\\s*define set directory^=. + set diffopt=internal,filler,closeoff set display= set fillchars=vert:\|,foldsep:\|,fold:- set formatoptions=tcq |