From 5547b16c40f92fbc75ad1b9a7b3dd1f5ff50cbb2 Mon Sep 17 00:00:00 2001 From: Ibby <33922797+SleepySwords@users.noreply.github.com> Date: Mon, 3 Apr 2023 22:13:15 +1000 Subject: vim-patch:9.0.1067: in diff mode virtual text is highlighted incorrectly Problem: In diff mode virtual text is highlighted incorrectly. (Rick Howe) Solution: Do not use diff attributes for virtual text. (closes vim/vim#11714) https://github.com/vim/vim/commit/d097af77797f030e0f29f9bbc298358a5addb2a5 Co-authored-by: Bram Moolenaar --- test/functional/ui/decorations_spec.lua | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'test/functional') diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 292743e21a..4579fad53f 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -648,6 +648,9 @@ describe('extmark decorations', function() [28] = {foreground = Screen.colors.SlateBlue}; [29] = {background = Screen.colors.Yellow1}; [30] = {reverse = true}; + [31] = {foreground = Screen.colors.SlateBlue, background = Screen.colors.LightMagenta}; + [32] = {bold = true, reverse = true}; + [33] = {background = Screen.colors.Red1, bold = true} } ns = meths.create_namespace 'test' @@ -1913,6 +1916,46 @@ bbbbbbb]]) | ]]} end) + + it('in diff mode virtual text is highlighted correct', function() + insert([[ + 9000 + 0009 + 0009 + 9000 + 0009 + ]]) + command("set diff") + meths.buf_set_extmark(0, ns, 0, 1, + { virt_text = { { 'test', 'Special' } }, virt_text_pos = 'inline', right_gravity = false }) + command("vnew") + insert([[ + 000 + 000 + 000 + 000 + 000 + ]]) + command("set diff") + feed('gg0') + screen:expect { grid = [[ + {27:^000 }│{33:9}{31:test}{27:000 }| + {27:000 }│{27:000}{33:9}{27: }| + {27:000 }│{27:000}{33:9}{27: }| + {27:000 }│{33:9}{27:000 }| + {27:000 }│{27:000}{33:9}{27: }| + │ | + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + {1:~ }│{1:~ }| + {32:[No Name] [+] }{30:[No Name] [+] }| + | + ]]} + end) end) describe('decorations: virtual lines', function() -- cgit