From 81c87857f632d1afe147e9b77a97da38f8f3a887 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Nov 2022 18:37:52 +0800 Subject: vim-patch:8.2.3698: match highlighting continues over breakindent Problem: Match highlighting continues over breakindent. Solution: Stop before the end column. (closes vim/vim#9242) https://github.com/vim/vim/commit/0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10 Cherry-pick Test_matchdelete_redraw() from patch 8.2.1077. Co-authored-by: Bram Moolenaar --- test/functional/legacy/match_spec.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test') diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua index 271f844f9d..eab2bff70a 100644 --- a/test/functional/legacy/match_spec.lua +++ b/test/functional/legacy/match_spec.lua @@ -36,3 +36,32 @@ describe('matchaddpos()', function() ]]) end) end) + +describe('match highlighting', function() + -- oldtest: Test_match_in_linebreak() + it('does not continue in linebreak vim-patch:8.2.3698', function() + local screen = Screen.new(75, 10) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg + }) + screen:attach() + exec([=[ + set breakindent linebreak breakat+=] + call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1) + call matchaddpos('ErrorMsg', [[1, 51]]) + ]=]) + screen:expect([[ + ^xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{1:]} | + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + end) +end) -- cgit From e38ae3b74ff513d991f8212dfbba75fe8c66aad3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Nov 2022 18:53:28 +0800 Subject: vim-patch:8.2.3940: match highlight disappears when doing incsearch for ":s/pat" Problem: Match highlight disappears when doing incsearch for ":s/pat". Solution: Only use line limit for incsearch highlighting. (closes vim/vim#9425) https://github.com/vim/vim/commit/94fb8274ca8c93a10102d41c8bcc848f75cb7334 Co-authored-by: Bram Moolenaar --- test/functional/legacy/match_spec.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'test') diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua index eab2bff70a..51cd60864e 100644 --- a/test/functional/legacy/match_spec.lua +++ b/test/functional/legacy/match_spec.lua @@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear = helpers.clear local exec = helpers.exec +local feed = helpers.feed before_each(clear) @@ -64,4 +65,36 @@ describe('match highlighting', function() | ]]) end) + + it('is shown with incsearch vim-patch:8.2.3940', function() + local screen = Screen.new(75, 6) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {background = Screen.colors.Yellow}, -- Search + [2] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg + }) + screen:attach() + exec([[ + set incsearch + call setline(1, range(20)) + call matchaddpos('ErrorMsg', [3]) + ]]) + screen:expect([[ + ^0 | + 1 | + {2:2} | + 3 | + 4 | + | + ]]) + feed(':s/0') + screen:expect([[ + {1:0} | + 1 | + {2:2} | + 3 | + 4 | + :s/0^ | + ]]) + end) end) -- cgit From a98970219ddc90b6f599203f6bb24da79fc6bbeb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Nov 2022 19:05:53 +0800 Subject: vim-patch:8.2.4062: match highlighting of tab too short Problem: Match highlighting of tab too short. Solution: Do not stop match highlighting if on a Tab. (Christian Brabandt, closes vim/vim#9507, closes vim/vim#9500) https://github.com/vim/vim/commit/0bbca540f7377889e2154aa5731f6eeffcb5c0cc Co-authored-by: Bram Moolenaar --- test/functional/legacy/match_spec.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test') diff --git a/test/functional/legacy/match_spec.lua b/test/functional/legacy/match_spec.lua index 51cd60864e..b6e45c396c 100644 --- a/test/functional/legacy/match_spec.lua +++ b/test/functional/legacy/match_spec.lua @@ -97,4 +97,30 @@ describe('match highlighting', function() :s/0^ | ]]) end) + + it('on a Tab vim-patch:8.2.4062', function() + local screen = Screen.new(75, 10) + screen:set_default_attr_ids({ + [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText + [1] = {background = Screen.colors.Red, foreground = Screen.colors.White}, -- ErrorMsg + }) + screen:attach() + exec([[ + set linebreak + call setline(1, "\tix") + call matchadd('ErrorMsg', '\t') + ]]) + screen:expect([[ + {1: ^ }ix | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + | + ]]) + end) end) -- cgit