view src/testdir/test_match_conceal.ok @ 8847:470ea7526cc6 v7.4.1711

commit https://github.com/vim/vim/commit/a742e084b677f76c67e9e52c4f9fb9ab24002e20 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Apr 5 21:10:38 2016 +0200 patch 7.4.1711 Problem: When using try/catch in 'statusline' it is still considered an error and the status line will be disabled. Solution: Check did_emsg instead of called_emsg. (haya14busa, closes https://github.com/vim/vim/issues/729)
author Christian Brabandt <cb@256bit.org>
date Tue, 05 Apr 2016 21:15:05 +0200
parents 1efa7c2b9368
children
line wrap: on
line source


# This is a Test

Test 1: simple addmatch()
# This is a Test    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]

Test 2: simple addmatch() and conceal (should be: #XThisXisXaXTest)
#XThisXisXaXTest    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]

Test 3: addmatch() and conceallevel=3 (should be: #ThisisaTest)
#ThisisaTest        
OK: g:attr[0]==g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]!=g:attr[5]

Test 4: more match() (should be: #Thisisa Test)
#Thisisa Test       
OK: g:attr[0]==g:attr[1] && g:attr[1]==g:attr[2] && g:attr[0]!=g:attr[3] && g:attr[3]==g:attr[4] && g:attr[0]!=g:attr[5] && g:attr[3]!=g:attr[5]

Test 5/1: default conceal char (should be: # This is a Test)
# This is a Test    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]

Test 5/2: default conceal char (should be: #+This+is+a+Test)
#+This+is+a+Test    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]

Test 6/1: syn and match conceal (should be: #ZThisZisZaZTest)
#ZThisZisZaZTest    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]

Test 6/2: syn and match conceal (should be: #*This*is*a*Test)
#*This*is*a*Test    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]

Test 7/1: clear matches
# This is a Test    
OK: g:attr[0]==g:attr[1] && g:attr[0]==g:attr[2] && g:attr[0]==g:attr[3] && g:attr[0]==g:attr[4] && g:attr[0]==g:attr[5]
{'group': 'Conceal', 'pattern': '\%2l ', 'priority': 10, 'id': 10, 'conceal': 'Z'}

Test 7/2: reset match using setmatches()
#ZThisZisZaZTest    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]

Test 8: using matchaddpos() (should be #Pis a Test
#Pis a Test         
OK: g:attr[0]!=g:attr[1] && g:attr[1]!=g:attr[2] && g:attr[0]==g:attr[2] && g:attr[0]==g:attr[3] && g:attr[0]!=g:attr[4] && g:attr[0]!=g:attr[5] && g:attr[4]==g:attr[5]
{'group': 'Conceal', 'id': 11, 'priority': 10, 'pos1': [2, 2, 6], 'conceal': 'P'}

Test 9: match using multibyte conceal char (should be: #ˑThisˑisˑaˑTest)
#ˑThisˑisˑaˑTest    
OK: g:attr[0]!=g:attr[1] && g:attr[1]==g:attr[2] && g:attr[1]==g:attr[3] && g:attr[1]==g:attr[4] && g:attr[0]==g:attr[5]