diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-07-21 15:48:27 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-07-21 15:48:27 +0200 |
commit | 6561d52ecbe6e24d1b90403078cc8b76c53c42fc (patch) | |
tree | f68a8d31545f7b89ae0e31a81f8e0ac0216a99ac /src/testdir/test_match_conceal.ok | |
parent | d51cb706a4e3ae99555bc214a64c83603c701139 (diff) | |
download | vim-6561d52ecbe6e24d1b90403078cc8b76c53c42fc.zip |
patch 7.4.792
Problem: Can only conceal text by defining syntax items.
Solution: Use matchadd() to define concealing. (Christian Brabandt)
Diffstat (limited to 'src/testdir/test_match_conceal.ok')
-rw-r--r-- | src/testdir/test_match_conceal.ok | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/testdir/test_match_conceal.ok b/src/testdir/test_match_conceal.ok new file mode 100644 index 000000000..11c379e2f --- /dev/null +++ b/src/testdir/test_match_conceal.ok @@ -0,0 +1,52 @@ + +# 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] |