patch 8.1.1276: cannot combine text properties with syntax highlighting
Problem: Cannot combine text properties with syntax highlighting.
Solution: Add the "combine" field to prop_type_add(). (closes #4343)
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim
index eab7aaa..a48aa91 100644
--- a/src/testdir/test_textprop.vim
+++ b/src/testdir/test_textprop.vim
@@ -559,14 +559,23 @@
return
endif
call writefile([
- \ "call setline(1, ['One two', 'Numbér 123 änd thœn 4¾7.', '--aa--bb--cc--dd--'])",
+ \ "call setline(1, ["
+ \ .. "'One two',"
+ \ .. "'Numbér 123 änd thœn 4¾7.',"
+ \ .. "'--aa--bb--cc--dd--',"
+ \ .. "'// comment with error in it',"
+ \ .. "])",
\ "hi NumberProp ctermfg=blue",
\ "hi LongProp ctermbg=yellow",
+ \ "hi BackgroundProp ctermbg=lightgrey",
+ \ "hi UnderlineProp cterm=underline",
\ "call prop_type_add('number', {'highlight': 'NumberProp'})",
\ "call prop_type_add('long', {'highlight': 'LongProp'})",
\ "call prop_type_add('start', {'highlight': 'NumberProp', 'start_incl': 1})",
\ "call prop_type_add('end', {'highlight': 'NumberProp', 'end_incl': 1})",
\ "call prop_type_add('both', {'highlight': 'NumberProp', 'start_incl': 1, 'end_incl': 1})",
+ \ "call prop_type_add('background', {'highlight': 'BackgroundProp', 'combine': 1})",
+ \ "call prop_type_add('error', {'highlight': 'UnderlineProp', 'combine': 1})",
\ "call prop_add(1, 4, {'end_lnum': 3, 'end_col': 3, 'type': 'long'})",
\ "call prop_add(2, 9, {'length': 3, 'type': 'number'})",
\ "call prop_add(2, 24, {'length': 4, 'type': 'number'})",
@@ -574,13 +583,17 @@
\ "call prop_add(3, 7, {'length': 2, 'type': 'start'})",
\ "call prop_add(3, 11, {'length': 2, 'type': 'end'})",
\ "call prop_add(3, 15, {'length': 2, 'type': 'both'})",
+ \ "call prop_add(4, 12, {'length': 10, 'type': 'background'})",
+ \ "call prop_add(4, 17, {'length': 5, 'type': 'error'})",
\ "set number",
\ "hi clear SpellBad",
\ "set spell",
+ \ "syn match Comment '//.*'",
+ \ "hi Comment ctermfg=green",
\ "normal 3G0llix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>",
\ "normal 3G0lli\<BS>\<Esc>",
\], 'XtestProp')
- let buf = RunVimInTerminal('-S XtestProp', {'rows': 6})
+ let buf = RunVimInTerminal('-S XtestProp', {'rows': 7})
call VerifyScreenDump(buf, 'Test_textprop_01', {})
" clean up