Mercurial > vim
diff src/testdir/test_textprop.vim @ 15314:c4d62945d96f v8.1.0665
patch 8.1.0665: text property display wrong when 'spell' is set
commit https://github.com/vim/vim/commit/c6d86dccc4edff8627e309fb23dc8f810ef36b28
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Dec 31 13:57:36 2018 +0100
patch 8.1.0665: text property display wrong when 'spell' is set
Problem: Text property display wrong when 'spell' is set. (Dominique Pelle)
Solution: Remove unnecessary assignment to char_attr. Combine attributes if
needed. Add a screenshot test.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 31 Dec 2018 14:00:06 +0100 |
parents | 2d8225cc1315 |
children | f58e7895cb40 |
line wrap: on
line diff
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -5,6 +5,8 @@ if !has('textprop') finish endif +source screendump.vim + func Test_proptype_global() call prop_type_add('comment', {'highlight': 'Directory', 'priority': 123, 'start_incl': 1, 'end_incl': 1}) let proptypes = prop_type_list() @@ -283,5 +285,27 @@ func Test_prop_byteoff() call prop_type_delete('comment') endfunc +" screenshot test with textprop highlighting +funct Test_textprop_screenshots() + if !CanRunVimInTerminal() + return + endif + call writefile([ + \ "call setline(1, ['One two', 'Number 123 and then 4567.', 'Three'])", + \ "hi NumberProp ctermfg=blue", + \ "hi LongProp ctermbg=yellow", + \ "call prop_type_add('number', {'highlight': 'NumberProp'})", + \ "call prop_type_add('long', {'highlight': 'LongProp'})", + \ "call prop_add(1, 4, {'end_lnum': 3, 'end_col': 3, 'type': 'long'})", + \ "call prop_add(2, 8, {'length': 3, 'type': 'number'})", + \ "call prop_add(2, 21, {'length': 4, 'type': 'number'})", + \ "set number", + \ "set spell", + \], 'XtestProp') + let buf = RunVimInTerminal('-S XtestProp', {}) + call VerifyScreenDump(buf, 'Test_textprop_01', {}) -" TODO: screenshot test with highlighting + " clean up + call StopVimInTerminal(buf) + call delete('Xtest_folds_with_rnu') +endfunc