Friday, December 27, 2019

Re: automatic redraw for multi-line syntax highlighting patterns


On Sat, Dec 28, 2019 at 12:32 AM Tom M <7tommm@gmail.com> wrote:
Hi,

the docs state (:help syn-multi-line) that syntax highlighting with multi-line patterns "mostly works as expected".  I am not sure if this "mostly" includes automatic highlighting change of a multi-line syntax group when it's modified. Especially as soon as the pattern's end is destroyed. For example, take the commands of a session file ~/tmp/s.vim:
call append(0, ['( comment?', ')'])  syntax sync fromstart  hi link m Comment  syntax match m /(.*\n)/  
They give us two lines highlighted as a comment (:hi Comment):
( comment?  )
Now, let's change the ')' into an 'x' via "2gg0rx". The test in the two lines does not match the defined syntax group anymore. But the display does not reflect this change right away. Instead I get something that's displayed partly as a comment (line 1) and partly as normal text (line 2):
( comment?  )
 Typo here. This last screen looks, of course, like this:
( comment?  x
Sorry for the confusion.

Tom

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAD_dSXjKeSDVXJ3XfHuLWHusKL0c5%3DmSLhDoe7LKbFs4DOaJ1g%40mail.gmail.com.

No comments: