patch 9.0.0452: Visual highlighting extends into virtual text prop
Problem: Visual highlighting extends into virtual text prop.
Solution: Do not highlight what isn't actually selected. Fix ordering of
stored text props.
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index aaf9a8e..235dd02 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -2855,11 +2855,15 @@
call setline(1, ['one two', 'three four', 'five six'])
call prop_type_add('above1', #{highlight: 'Search'})
call prop_type_add('above2', #{highlight: 'DiffChange'})
+ call prop_type_add('below', #{highlight: 'DiffAdd'})
call prop_add(1, 0, #{type: 'above1', text: 'first thing above', text_align: 'above'})
call prop_add(1, 0, #{type: 'above2', text: 'second thing above', text_align: 'above'})
call prop_add(3, 0, #{type: 'above1', text: 'another thing', text_align: 'above', text_padding_left: 3})
normal gglllj
+ func AddPropBelow()
+ call prop_add(1, 0, #{type: 'below', text: 'below', text_align: 'below'})
+ endfunc
END
call writefile(lines, 'XscriptPropsWithTextAbove', 'D')
let buf = RunVimInTerminal('-S XscriptPropsWithTextAbove', #{rows: 9, cols: 60})
@@ -2876,6 +2880,12 @@
call term_sendkeys(buf, ":set nowrap\<CR>gg$j")
call VerifyScreenDump(buf, 'Test_prop_with_text_above_5', {})
+ call term_sendkeys(buf, ":call AddPropBelow()\<CR>")
+ call term_sendkeys(buf, "ggve")
+ call VerifyScreenDump(buf, 'Test_prop_with_text_above_6', {})
+ call term_sendkeys(buf, "V")
+ call VerifyScreenDump(buf, 'Test_prop_with_text_above_7', {})
+
call StopVimInTerminal(buf)
endfunc