Mercurial > vim
comparison src/testdir/test_textprop.vim @ 16545:7a563ee902b6 v8.1.1276
patch 8.1.1276: cannot combine text properties with syntax highlighting
commit https://github.com/vim/vim/commit/de24a8701328b1cce7cad0ee11b415369b482420
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 5 15:48:00 2019 +0200
patch 8.1.1276: cannot combine text properties with syntax highlighting
Problem: Cannot combine text properties with syntax highlighting.
Solution: Add the "combine" field to prop_type_add(). (closes https://github.com/vim/vim/issues/4343)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 05 May 2019 16:00:05 +0200 |
parents | 176872829dc2 |
children | 1fc9cd08cf3c |
comparison
equal
deleted
inserted
replaced
16544:609f0de1e64c | 16545:7a563ee902b6 |
---|---|
557 " The Vim running in the terminal needs to use utf-8. | 557 " The Vim running in the terminal needs to use utf-8. |
558 if !CanRunVimInTerminal() || g:orig_encoding != 'utf-8' | 558 if !CanRunVimInTerminal() || g:orig_encoding != 'utf-8' |
559 return | 559 return |
560 endif | 560 endif |
561 call writefile([ | 561 call writefile([ |
562 \ "call setline(1, ['One two', 'Numbér 123 änd thœn 4¾7.', '--aa--bb--cc--dd--'])", | 562 \ "call setline(1, [" |
563 \ .. "'One two'," | |
564 \ .. "'Numbér 123 änd thœn 4¾7.'," | |
565 \ .. "'--aa--bb--cc--dd--'," | |
566 \ .. "'// comment with error in it'," | |
567 \ .. "])", | |
563 \ "hi NumberProp ctermfg=blue", | 568 \ "hi NumberProp ctermfg=blue", |
564 \ "hi LongProp ctermbg=yellow", | 569 \ "hi LongProp ctermbg=yellow", |
570 \ "hi BackgroundProp ctermbg=lightgrey", | |
571 \ "hi UnderlineProp cterm=underline", | |
565 \ "call prop_type_add('number', {'highlight': 'NumberProp'})", | 572 \ "call prop_type_add('number', {'highlight': 'NumberProp'})", |
566 \ "call prop_type_add('long', {'highlight': 'LongProp'})", | 573 \ "call prop_type_add('long', {'highlight': 'LongProp'})", |
567 \ "call prop_type_add('start', {'highlight': 'NumberProp', 'start_incl': 1})", | 574 \ "call prop_type_add('start', {'highlight': 'NumberProp', 'start_incl': 1})", |
568 \ "call prop_type_add('end', {'highlight': 'NumberProp', 'end_incl': 1})", | 575 \ "call prop_type_add('end', {'highlight': 'NumberProp', 'end_incl': 1})", |
569 \ "call prop_type_add('both', {'highlight': 'NumberProp', 'start_incl': 1, 'end_incl': 1})", | 576 \ "call prop_type_add('both', {'highlight': 'NumberProp', 'start_incl': 1, 'end_incl': 1})", |
577 \ "call prop_type_add('background', {'highlight': 'BackgroundProp', 'combine': 1})", | |
578 \ "call prop_type_add('error', {'highlight': 'UnderlineProp', 'combine': 1})", | |
570 \ "call prop_add(1, 4, {'end_lnum': 3, 'end_col': 3, 'type': 'long'})", | 579 \ "call prop_add(1, 4, {'end_lnum': 3, 'end_col': 3, 'type': 'long'})", |
571 \ "call prop_add(2, 9, {'length': 3, 'type': 'number'})", | 580 \ "call prop_add(2, 9, {'length': 3, 'type': 'number'})", |
572 \ "call prop_add(2, 24, {'length': 4, 'type': 'number'})", | 581 \ "call prop_add(2, 24, {'length': 4, 'type': 'number'})", |
573 \ "call prop_add(3, 3, {'length': 2, 'type': 'number'})", | 582 \ "call prop_add(3, 3, {'length': 2, 'type': 'number'})", |
574 \ "call prop_add(3, 7, {'length': 2, 'type': 'start'})", | 583 \ "call prop_add(3, 7, {'length': 2, 'type': 'start'})", |
575 \ "call prop_add(3, 11, {'length': 2, 'type': 'end'})", | 584 \ "call prop_add(3, 11, {'length': 2, 'type': 'end'})", |
576 \ "call prop_add(3, 15, {'length': 2, 'type': 'both'})", | 585 \ "call prop_add(3, 15, {'length': 2, 'type': 'both'})", |
586 \ "call prop_add(4, 12, {'length': 10, 'type': 'background'})", | |
587 \ "call prop_add(4, 17, {'length': 5, 'type': 'error'})", | |
577 \ "set number", | 588 \ "set number", |
578 \ "hi clear SpellBad", | 589 \ "hi clear SpellBad", |
579 \ "set spell", | 590 \ "set spell", |
591 \ "syn match Comment '//.*'", | |
592 \ "hi Comment ctermfg=green", | |
580 \ "normal 3G0llix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>", | 593 \ "normal 3G0llix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>lllix\<Esc>", |
581 \ "normal 3G0lli\<BS>\<Esc>", | 594 \ "normal 3G0lli\<BS>\<Esc>", |
582 \], 'XtestProp') | 595 \], 'XtestProp') |
583 let buf = RunVimInTerminal('-S XtestProp', {'rows': 6}) | 596 let buf = RunVimInTerminal('-S XtestProp', {'rows': 7}) |
584 call VerifyScreenDump(buf, 'Test_textprop_01', {}) | 597 call VerifyScreenDump(buf, 'Test_textprop_01', {}) |
585 | 598 |
586 " clean up | 599 " clean up |
587 call StopVimInTerminal(buf) | 600 call StopVimInTerminal(buf) |
588 call delete('XtestProp') | 601 call delete('XtestProp') |