diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-10 13:39:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-10 13:39:35 +0100 |
commit | 1d8844aa59416dd306912b5563b8e928dfd387ba (patch) | |
tree | 9d5e2b69de159ff399f6ac377db5dc766ef39105 | |
parent | 52de3a8d3943520bbd4e5e40a4c43fcc7182dac0 (diff) |
patch 9.0.0184: virtual text prop highlight continues after truncationv9.0.0184
Problem: Virtual text prop highlight continues after truncation.
Solution: Recompute the length of attributes.
-rw-r--r-- | src/drawline.c | 1 | ||||
-rw-r--r-- | src/testdir/dumps/Test_prop_with_wrap_1.dump | 6 | ||||
-rw-r--r-- | src/testdir/test_textprop.vim | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 27 insertions, 0 deletions
diff --git a/src/drawline.c b/src/drawline.c index 0300f373a6..5d9dcc37e2 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1793,6 +1793,7 @@ win_line( wlv.p_extra = p_extra_free2 = l; wlv.n_extra = n_used + added; n_attr_skip = added; + n_attr = mb_charlen(wlv.p_extra); } } diff --git a/src/testdir/dumps/Test_prop_with_wrap_1.dump b/src/testdir/dumps/Test_prop_with_wrap_1.dump new file mode 100644 index 0000000000..c4bf86683b --- /dev/null +++ b/src/testdir/dumps/Test_prop_with_wrap_1.dump @@ -0,0 +1,6 @@ +>a+0&#ffffff0|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|s+0#e000e06&|o|m|e| |v|i|… +|d+0#0000000&|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| @17 +|~+0#4040ff13&| @48 +|~| @48 +|~| @48 +| +0#0000000&@31|1|,|1| @10|A|l@1| diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index dd3f760aaa..8533af3cd2 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -1898,6 +1898,24 @@ func Test_prop_with_linebreak() call delete('XscriptPropWithLinebreak') endfunc +func Test_prop_with_wrap() + CheckRunVimInTerminal + + let lines =<< trim END + vim9script + set linebreak + setline(1, 'asdf '->repeat(15)) + prop_type_add('test', {highlight: 'Special'}) + prop_add(1, 43, {text: 'some virtual text', type: 'test'}) + END + call writefile(lines, 'XscriptPropWithWrap') + let buf = RunVimInTerminal('-S XscriptPropWithWrap', #{rows: 6, cols: 50}) + call VerifyScreenDump(buf, 'Test_prop_with_wrap_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptPropWithWrap') +endfunc + func Test_prop_after_tab() CheckRunVimInTerminal diff --git a/src/version.c b/src/version.c index 582cb3655a..27503b5951 100644 --- a/src/version.c +++ b/src/version.c @@ -736,6 +736,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 184, +/**/ 183, /**/ 182, |