Mercurial > vim
diff src/testdir/test_textprop.vim @ 18317:d2228d4cf1f6 v8.1.2153
patch 8.1.2153: combining text property and syntax highlight is wrong
Commit: https://github.com/vim/vim/commit/3439028c8909aaa71ffe612a7191babdfe07c04c
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Oct 16 14:38:26 2019 +0200
patch 8.1.2153: combining text property and syntax highlight is wrong
Problem: Combining text property and syntax highlight is wrong. (Nick
Jensen)
Solution: Compute the syntax highlight attribute much earlier.
(closes #5057)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 16 Oct 2019 14:45:04 +0200 |
parents | 52f23198af7f |
children | 967ca19425e3 |
line wrap: on
line diff
--- 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'})