Mercurial > vim
comparison src/testdir/test_textprop.vim @ 29607:33d7c1fa2dac v9.0.0144
patch 9.0.0144: text property cannot override 'cursorline' highlight
Commit: https://github.com/vim/vim/commit/f4ba8bc47eb3c6b5899ef31d083b9b8f0d4ca456
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 5 17:05:04 2022 +0100
patch 9.0.0144: text property cannot override 'cursorline' highlight
Problem: Text property cannot override 'cursorline' highlight.
Solution: Add the "override" flag to prop_type_add(). (closes https://github.com/vim/vim/issues/5533,
closes #8225).
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 05 Aug 2022 18:15:08 +0200 |
parents | 0340a59e04ca |
children | e1c370197030 |
comparison
equal
deleted
inserted
replaced
29606:3e5d197e698e | 29607:33d7c1fa2dac |
---|---|
1129 call VerifyScreenDump(buf, 'Test_textprop_01', {}) | 1129 call VerifyScreenDump(buf, 'Test_textprop_01', {}) |
1130 | 1130 |
1131 " clean up | 1131 " clean up |
1132 call StopVimInTerminal(buf) | 1132 call StopVimInTerminal(buf) |
1133 call delete('XtestProp') | 1133 call delete('XtestProp') |
1134 endfunc | |
1135 | |
1136 func Test_textprop_hl_override() | |
1137 CheckScreendump | |
1138 | |
1139 let lines =<< trim END | |
1140 call setline(1, ['One one one one one', 'Two two two two two', 'Three three three three']) | |
1141 hi OverProp ctermfg=blue ctermbg=yellow | |
1142 hi CursorLine cterm=bold,underline ctermfg=red ctermbg=green | |
1143 hi Vsual ctermfg=cyan ctermbg=grey | |
1144 call prop_type_add('under', #{highlight: 'OverProp'}) | |
1145 call prop_type_add('over', #{highlight: 'OverProp', override: 1}) | |
1146 call prop_add(1, 5, #{type: 'under', length: 4}) | |
1147 call prop_add(1, 13, #{type: 'over', length: 4}) | |
1148 call prop_add(2, 5, #{type: 'under', length: 4}) | |
1149 call prop_add(2, 13, #{type: 'over', length: 4}) | |
1150 call prop_add(3, 5, #{type: 'under', length: 4}) | |
1151 call prop_add(3, 13, #{type: 'over', length: 4}) | |
1152 set cursorline | |
1153 2 | |
1154 END | |
1155 call writefile(lines, 'XtestOverProp') | |
1156 let buf = RunVimInTerminal('-S XtestOverProp', {'rows': 8}) | |
1157 call VerifyScreenDump(buf, 'Test_textprop_hl_override_1', {}) | |
1158 | |
1159 call term_sendkeys(buf, "3Gllv$hh") | |
1160 call VerifyScreenDump(buf, 'Test_textprop_hl_override_2', {}) | |
1161 call term_sendkeys(buf, "\<Esc>") | |
1162 | |
1163 " clean up | |
1164 call StopVimInTerminal(buf) | |
1165 call delete('XtestOverProp') | |
1134 endfunc | 1166 endfunc |
1135 | 1167 |
1136 func RunTestVisualBlock(width, dump) | 1168 func RunTestVisualBlock(width, dump) |
1137 call writefile([ | 1169 call writefile([ |
1138 \ "call setline(1, [" | 1170 \ "call setline(1, [" |