------------------------
--- Sample text file ---
ABC Just after an abc match
Y Inside a yz region Z
--- Syntax file ---
syn match abc /ABC/ conceal cchar=-
hi link abc Comment
syn region yz matchgroup=yz_ends start=/Y/ end=/Z/ concealends cchar=-
hi link yz String
hi link yz_ends Error
set conceallevel=2
set concealcursor=nc
------------------------
*** Observations ***
The ABC region (created with match) behaves as expected: i.e., when
cursor is on the line, and Vim is in normal mode, the ABC is displayed
as a `-' highlighted as Conceal. If I enter insert mode, the `-' changes
to the actual text (ABC) highlighted as a Comment. So far so good...
Now comes the unexpected part... With the cursor on the 2nd line (the
one containing the yz region), and Vim in normal mode, the region end
token (Z) is displayed as cchar (`-') (as expected), but the start token
(Y) is *completely* concealed (as it would be for conceallevel=3). If I
enter insert mode, both start and end tokens are displayed as the actual
text highlighted as Error. While the insert mode behavior makes sense, I
would have expected the treatment of the start and end tokens to be
identical in normal mode: i.e., I would expect them both to be replaced
by cchar.
Interestingly, if I set conceallevel=1, both start and end tokens are
displayed as cchar; thus, Vim seems to be aware that the `-' custom
replacement character applies to the start token as well as the end
token, so why isn't it used when conceallevel=2? Have I misunderstood
how this is supposed to work, or is this a bug?
Thanks,
Brett Stahlman
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment