diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-16 14:38:26 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-16 14:38:26 +0200 |
commit | 3439028c8909aaa71ffe612a7191babdfe07c04c (patch) | |
tree | d81fd19be2e758a554ed1cccdfd1353bbd6d3bd8 /src/testdir/test_textprop.vim | |
parent | 27fc8cab227e30f649f52e74efd58ad56d21e9bb (diff) | |
download | vim-git-3439028c8909aaa71ffe612a7191babdfe07c04c.tar.gz |
patch 8.1.2153: combining text property and syntax highlight is wrongv8.1.2153
Problem: Combining text property and syntax highlight is wrong. (Nick
Jensen)
Solution: Compute the syntax highlight attribute much earlier.
(closes #5057)
Diffstat (limited to 'src/testdir/test_textprop.vim')
-rw-r--r-- | src/testdir/test_textprop.vim | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/src/testdir/test_textprop.vim b/src/testdir/test_textprop.vim index aede59b2d..54cf5f3c7 100644 --- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -652,9 +652,10 @@ endfunc " screenshot test with textprop highlighting func Test_textprop_screenshot_various() + CheckScreendump " The Vim running in the terminal needs to use utf-8. - if !CanRunVimInTerminal() || g:orig_encoding != 'utf-8' - throw 'Skipped: cannot make screendumps or not using utf-8' + if g:orig_encoding != 'utf-8' + throw 'Skipped: not using utf-8' endif call writefile([ \ "call setline(1, [" @@ -750,9 +751,7 @@ endfunc " screenshot test with Visual block mode operations func Test_textprop_screenshot_visual() - if !CanRunVimInTerminal() - throw 'Skipped: cannot make screendumps' - endif + CheckScreendump " Delete two columns while text props are three chars wide. call RunTestVisualBlock(2, '01') @@ -762,9 +761,7 @@ func Test_textprop_screenshot_visual() endfunc func Test_textprop_after_tab() - if !CanRunVimInTerminal() - throw 'Skipped: cannot make screendumps' - endif + CheckScreendump let lines =<< trim END call setline(1, [ @@ -785,6 +782,28 @@ func Test_textprop_after_tab() call delete('XtestPropTab') endfunc +func Test_textprop_with_syntax() + CheckScreendump + + let lines =<< trim END + call setline(1, [ + \ "(abc)", + \ ]) + syn match csParens "[()]" display + hi! link csParens MatchParen + + call prop_type_add('TPTitle', #{ highlight: 'Title' }) + call prop_add(1, 2, #{type: 'TPTitle', end_col: 5}) + END + call writefile(lines, 'XtestPropSyn') + let buf = RunVimInTerminal('-S XtestPropSyn', {'rows': 6}) + call VerifyScreenDump(buf, 'Test_textprop_syn_1', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XtestPropSyn') +endfunc + " Adding a text property to a new buffer should not fail func Test_textprop_empty_buffer() call prop_type_add('comment', {'highlight': 'Search'}) |