ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Re: vim syntax highlighting bug?
@ 2024-01-22 23:25 Damien Thiriet via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Damien Thiriet via ntg-context @ 2024-01-22 23:25 UTC (permalink / raw)
  To: ntg-context; +Cc: damien

Thanks Vincent for your patch, solved this issue.

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [NTG-context] Re: vim syntax highlighting bug?
  2024-01-08 11:16 ` Vincent Hennebert
@ 2024-01-09 15:39   ` Gerion Entrup
  0 siblings, 0 replies; 4+ messages in thread
From: Gerion Entrup @ 2024-01-09 15:39 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 2170 bytes --]

Thanks for your effort!
I have the same problem in Neovim and linked the pull request there:
https://github.com/neovim/neovim/issues/26966

Best,
Gerion

Am Montag, 8. Januar 2024, 12:16:14 CET schrieb Vincent Hennebert:
> 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


[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [NTG-context] Re: vim syntax highlighting bug?
  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
  2024-01-09 15:39   ` Gerion Entrup
  1 sibling, 1 reply; 4+ messages in thread
From: Vincent Hennebert @ 2024-01-08 11:16 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [NTG-context] Re: vim syntax highlighting bug?
  2024-01-06 11:28 [NTG-context] " Damien Thiriet via ntg-context
@ 2024-01-06 15:24 ` Christian Prim via ntg-context
  2024-01-08 11:16 ` Vincent Hennebert
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Prim via ntg-context @ 2024-01-06 15:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Christian Prim


[-- Attachment #1.1.1: Type: text/plain, Size: 1648 bytes --]

Hello

on my installation, it's working:
[image: image.png]
But I'm on an old version on debian:
VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Oct 01 2021 01:51:08)
Inklusive der Patches: 1-2434
Extra Patches: 8.2.3402, 8.2.3403, 8.2.3409, 8.2.3428

Perhaps something has changed in version 9.0...

Hope it helps

Christian

Am Sa., 6. Jan. 2024 um 13:04 Uhr schrieb Damien Thiriet via ntg-context <
ntg-context@ntg.nl>:

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

[-- Attachment #1.1.2: Type: text/html, Size: 2617 bytes --]

[-- Attachment #1.2: image.png --]
[-- Type: image/png, Size: 22635 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-23  0:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 23:25 [NTG-context] Re: vim syntax highlighting bug? Damien Thiriet via ntg-context
  -- strict thread matches above, loose matches on Subject: below --
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
2024-01-09 15:39   ` Gerion Entrup

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