Multiple conceals collapse to single character

5 messages
Open this post in threaded view
|

Multiple conceals collapse to single character

 Multiple conceal matches/regions get collapsed into a single character.   I'm not sure if this is intended, but it is certainly confusing.  It also prevents at least one example in the documentation from working sensibly: e.g., from :help :syn-cchar syntax match Entity "&" conceal cchar=& But, if you also define: syntax match Entity "<" conceal cchar=< A line with: &< collapses to: & Whereas: <& collapses to: < In the 'Greek characters in TeX' case (see vim-use), the Greek chars and superscripts, etc. are defined like: syntax match texGreek '\\alpha\>' contained conceal cchar=α syntax match texGreek '\\beta\>' contained conceal cchar=β ...etc... syntax match texSuperscript '\^2' contained conceal cchar=² ...etc... So: $\alpha^2$ $\alpha\beta$ $\alpha^2\beta$ all collapse to: $α$ Personally, I think the behavior should be to collapse grouped on cchar/null.  Using an example that has some corner cases: e.g. syntax match a /a/ conceal syntax match a /b/ cchar=  conceal syntax match a /c/ conceal cchar=C syntax match a /d/ conceal Then: "abcd" collapses to: " C " (/a/ and /b/ are grouped using default 'listchars' where their cchar's both equate to cchar=' '.  /d/ is not grouped with /c/, even though it doesn't define a cchar, because 'C' != ' '.) And speaking of corner cases, is there a way to get cchar=' ' or some other syntax to be recognized as an explicit cchar of ?  It seems odd that 'cchar= ' is whitespace-sensitive. -- Best, Ben -- You received this message from the "vim_dev" 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
Open this post in threaded view
|

Re: Multiple conceals collapse to single character

 On 10/07/10 20:18, Benjamin R. Haskell wrote: > Multiple conceal matches/regions get collapsed into a single character. > I'm not sure if this is intended, but it is certainly confusing.  It > also prevents at least one example in the documentation from working > sensibly: > > e.g., from :help :syn-cchar > > syntax match Entity "&" conceal cchar=& > > But, if you also define: > > syntax match Entity "<" conceal cchar=< > > A line with: > > &< > collapses to: > & > > Whereas: > <& > collapses to: > < > > In the 'Greek characters in TeX' case (see vim-use), the Greek chars and > superscripts, etc. are defined like: > > syntax match texGreek '\\alpha\>' contained conceal cchar=α > syntax match texGreek '\\beta\>' contained conceal cchar=β > ...etc... > syntax match texSuperscript '\^2' contained conceal cchar=² > ...etc... > > So: > > $\alpha^2$ > $\alpha\beta$ > $\alpha^2\beta$ > > all collapse to: > > $α$ > > Personally, I think the behavior should be to collapse grouped on > cchar/null.  Using an example that has some corner cases: > > e.g. > syntax match a /a/ conceal > syntax match a /b/ cchar=  conceal > syntax match a /c/ conceal cchar=C > syntax match a /d/ conceal > > Then: > "abcd" > collapses to: > " C" > > (/a/ and /b/ are grouped using default 'listchars' where their cchar's > both equate to cchar=' '.  /d/ is not grouped with /c/, even though it > doesn't define a cchar, because 'C' != ' '.) > > And speaking of corner cases, is there a way to get cchar=' ' or some > other syntax to be recognized as an explicit cchar of?  It seems > odd that 'cchar= ' is whitespace-sensitive. > Have you tried 'cchar=\ ' (without the quotes)? (I haven't). Best regards, Tony. -- There is no time like the pleasant. -- You received this message from the "vim_dev" 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
Open this post in threaded view
|

Re: Multiple conceals collapse to single character

 On Sat, 10 Jul 2010, Tony Mechelynck wrote: > On 10/07/10 20:18, Benjamin R. Haskell wrote: > > [...] Using an example that has some corner cases: > > > > e.g. > > syntax match a /a/ conceal > > syntax match a /b/ cchar=  conceal > > syntax match a /c/ conceal cchar=C > > syntax match a /d/ conceal > > > > [...] And speaking of corner cases, is there a way to get cchar=' ' > > or some other syntax to be recognized as an explicit cchar > > of ?  It seems odd that 'cchar= ' is whitespace-sensitive. > > > > Have you tried 'cchar=\ ' (without the quotes)? (I haven't). Yep, that was my first attempt.  The backslash is interpreted as the cchar. -- Best, Ben -- You received this message from the "vim_dev" 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