Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
30232:b0eb842f1c15 | 30233:8d660a45299f |
---|---|
2853 | 2853 |
2854 let lines =<< trim END | 2854 let lines =<< trim END |
2855 call setline(1, ['one two', 'three four', 'five six']) | 2855 call setline(1, ['one two', 'three four', 'five six']) |
2856 call prop_type_add('above1', #{highlight: 'Search'}) | 2856 call prop_type_add('above1', #{highlight: 'Search'}) |
2857 call prop_type_add('above2', #{highlight: 'DiffChange'}) | 2857 call prop_type_add('above2', #{highlight: 'DiffChange'}) |
2858 call prop_type_add('below', #{highlight: 'DiffAdd'}) | |
2858 call prop_add(1, 0, #{type: 'above1', text: 'first thing above', text_align: 'above'}) | 2859 call prop_add(1, 0, #{type: 'above1', text: 'first thing above', text_align: 'above'}) |
2859 call prop_add(1, 0, #{type: 'above2', text: 'second thing above', text_align: 'above'}) | 2860 call prop_add(1, 0, #{type: 'above2', text: 'second thing above', text_align: 'above'}) |
2860 call prop_add(3, 0, #{type: 'above1', text: 'another thing', text_align: 'above', text_padding_left: 3}) | 2861 call prop_add(3, 0, #{type: 'above1', text: 'another thing', text_align: 'above', text_padding_left: 3}) |
2861 | 2862 |
2862 normal gglllj | 2863 normal gglllj |
2864 func AddPropBelow() | |
2865 call prop_add(1, 0, #{type: 'below', text: 'below', text_align: 'below'}) | |
2866 endfunc | |
2863 END | 2867 END |
2864 call writefile(lines, 'XscriptPropsWithTextAbove', 'D') | 2868 call writefile(lines, 'XscriptPropsWithTextAbove', 'D') |
2865 let buf = RunVimInTerminal('-S XscriptPropsWithTextAbove', #{rows: 9, cols: 60}) | 2869 let buf = RunVimInTerminal('-S XscriptPropsWithTextAbove', #{rows: 9, cols: 60}) |
2866 call VerifyScreenDump(buf, 'Test_prop_with_text_above_1', {}) | 2870 call VerifyScreenDump(buf, 'Test_prop_with_text_above_1', {}) |
2867 | 2871 |
2873 call term_sendkeys(buf, ":set number signcolumn=yes\<CR>") | 2877 call term_sendkeys(buf, ":set number signcolumn=yes\<CR>") |
2874 call VerifyScreenDump(buf, 'Test_prop_with_text_above_4', {}) | 2878 call VerifyScreenDump(buf, 'Test_prop_with_text_above_4', {}) |
2875 | 2879 |
2876 call term_sendkeys(buf, ":set nowrap\<CR>gg$j") | 2880 call term_sendkeys(buf, ":set nowrap\<CR>gg$j") |
2877 call VerifyScreenDump(buf, 'Test_prop_with_text_above_5', {}) | 2881 call VerifyScreenDump(buf, 'Test_prop_with_text_above_5', {}) |
2882 | |
2883 call term_sendkeys(buf, ":call AddPropBelow()\<CR>") | |
2884 call term_sendkeys(buf, "ggve") | |
2885 call VerifyScreenDump(buf, 'Test_prop_with_text_above_6', {}) | |
2886 call term_sendkeys(buf, "V") | |
2887 call VerifyScreenDump(buf, 'Test_prop_with_text_above_7', {}) | |
2878 | 2888 |
2879 call StopVimInTerminal(buf) | 2889 call StopVimInTerminal(buf) |
2880 endfunc | 2890 endfunc |
2881 | 2891 |
2882 func Test_props_with_text_override() | 2892 func Test_props_with_text_override() |