Mercurial > vim
comparison src/testdir/test_textprop.vim @ 34397:f0cdbcf53264 v9.1.0124
patch 9.1.0124: display of below/right virtual text with non-virtual text overlap
Commit: https://github.com/vim/vim/commit/8055721c2d30f21cfabe7453014f526e7becfc06
Author: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Date: Wed Feb 21 21:00:59 2024 +0100
patch 9.1.0124: display of below/right virtual text with non-virtual text overlap
Problem: Virtual text with text_align 'right'/'below' wasn't being
used when a non-virtual text property overlaps with the end of
the line. This was because the non-virtual text property had a
higher priority, preventing the virtual text from being used.
Solution: Fix the sorting of text properties so virtual text properties
have a higher priority than non-virtual text properties.
(Dylan Thacker-Smith)
related: #14063
Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 21 Feb 2024 21:15:03 +0100 |
parents | 2c5ae1ce5af2 |
children | 84a5cafeb34c |
comparison
equal
deleted
inserted
replaced
34396:b0f19afada63 | 34397:f0cdbcf53264 |
---|---|
4088 call VerifyScreenDump(buf, 'Test_text_below_nowrap_1', {}) | 4088 call VerifyScreenDump(buf, 'Test_text_below_nowrap_1', {}) |
4089 | 4089 |
4090 call StopVimInTerminal(buf) | 4090 call StopVimInTerminal(buf) |
4091 endfunc | 4091 endfunc |
4092 | 4092 |
4093 func Test_virtual_text_overlap_with_highlight() | |
4094 CheckRunVimInTerminal | |
4095 | |
4096 let lines =<< trim END | |
4097 vim9script | |
4098 setline(1, ['one', 'two', 'three', 'four', 'five']) | |
4099 set number | |
4100 | |
4101 prop_type_add('demo_highlight_warning', {highlight: 'WarningMsg'}) | |
4102 prop_type_add('demo_virtual_text_error', {highlight: 'Error'}) | |
4103 | |
4104 prop_add(2, 4, { | |
4105 type: 'demo_highlight_warning', | |
4106 end_col: 4, | |
4107 }) | |
4108 prop_add(2, 0, { | |
4109 type: 'demo_virtual_text_error', | |
4110 text: 'syntax error', | |
4111 text_align: 'below', | |
4112 }) | |
4113 normal 2j | |
4114 | |
4115 prop_add(4, 4, { | |
4116 type: 'demo_highlight_warning', | |
4117 end_lnum: 5, | |
4118 end_col: 1, | |
4119 }) | |
4120 prop_add(4, 0, { | |
4121 type: 'demo_virtual_text_error', | |
4122 text: 'other error', | |
4123 text_align: 'right', | |
4124 }) | |
4125 END | |
4126 call writefile(lines, 'XVirtualTextOverlapWithHighlight', 'D') | |
4127 let buf = RunVimInTerminal('-S XVirtualTextOverlapWithHighlight', #{rows: 8, cols: 60}) | |
4128 call VerifyScreenDump(buf, 'Test_virtual_text_overlap_with_highlight_1', {}) | |
4129 | |
4130 call StopVimInTerminal(buf) | |
4131 endfunc | |
4132 | |
4093 func Test_virtual_text_in_popup_highlight() | 4133 func Test_virtual_text_in_popup_highlight() |
4094 CheckRunVimInTerminal | 4134 CheckRunVimInTerminal |
4095 | 4135 |
4096 let lines =<< trim END | 4136 let lines =<< trim END |
4097 vim9script | 4137 vim9script |