ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vincent Hennebert <vhennebert@gmail.com>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: vim syntax highlighting bug?
Date: Mon, 8 Jan 2024 12:16:14 +0100	[thread overview]
Message-ID: <a7947133-721f-49d5-9725-6bba0493e6ff@gmail.com> (raw)
In-Reply-To: <96f998e92ddb10f1f56a37a5ad776338@thiriet.web4me.fr>

I was in touch with the maintainer of the context.vim syntax file about 
this. It turns out to be an issue with the lua.vim file that is included 
in the context one. Lua.vim highlights trailing parentheses as errors, 
but that’s done in a way that doesn’t work well when the file is 
included by other syntax files. It somehow steals the syntax context and 
makes Vim stay in Lua mode when it should go back to ConTeXt mode (I’m 
not too savvy of the details).

The maintainer came up with a workaround [1] to force returning to 
ConTeXt mode, although the parenthesis remains highlighted as an error.

That highlight bothers me, so my own workaround is to copy the lua.vim 
file in my own .vim/syntax folder and comment out the ‘syn match 
luaParenError ")"’ line (l.61 in my Vim version).

Maybe playing with the ‘contained’ keyword (in lua.vim) could lead to a 
proper solution, but I’m happy enough with my workaround that I haven’t 
felt the need to investigate this issue any further.

Hope that helps,
Vincent

[1] https://github.com/vim/vim/pull/13778

On 06/01/2024 12:28, Damien Thiriet via ntg-context wrote:
> Hello,
> 
> 
> Happy New Year!
> 
> I got into a bug in my Vim syntax highlighting version.
> Highlight stays in lua mode after ctxlua macro is closed.
> Here is a MWE, where «this should not be highlitghted as
> a comment indeed is.
> 
> \starttext
> 
> Hello!
> \ctxlua{context("does the parser work?")}
> 
> -- this should not be highlighted as a comment
> 
> \stoptext
> 
> Do other Vim users come into this?
> Is my syntax file outdated?
> 
> I am using this Vim version on OpenBSD 7.3 -stable:
> VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep  6 2023 08:55:14)
> Included patches: 1-1876
> 
> Best regards,
> 
> Damien Thiriet
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry 
> to the Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2024-01-08 11:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-06 11:28 [NTG-context] " Damien Thiriet via ntg-context
2024-01-06 15:24 ` [NTG-context] " Christian Prim via ntg-context
2024-01-08 11:16 ` Vincent Hennebert [this message]
2024-01-09 15:39   ` Gerion Entrup
2024-01-22 23:25 Damien Thiriet via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7947133-721f-49d5-9725-6bba0493e6ff@gmail.com \
    --to=vhennebert@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).