Mercurial > vim
diff src/testdir/test_textprop.vim @ 30233:8d660a45299f v9.0.0452
patch 9.0.0452: Visual highlighting extends into virtual text prop
Commit: https://github.com/vim/vim/commit/6eda17d881c9b2880ccb2a4d11951939a58f233d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 12 19:25:11 2022 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 12 Sep 2022 20:30:06 +0200 |
parents | 0d084880276a |
children | 8f85b5c45432 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2855,11 +2855,15 @@ func Test_props_with_text_above() 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 @@ func Test_props_with_text_above() 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