Re: [NTG-context] (any) neovim users?

2022-10-15 Thread Hans Hagen via ntg-context

On 10/14/2022 5:00 PM, Alan Braslau via ntg-context wrote:

A recent upgrade of the editor neovim leads to the following error
when using % identification at the head of .tex source files.


Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: 
/usr/local/share/nvim/runtime/lua/vim/filetype/detect.lua:1248: attempt to 
index local 'format' (a number
  value)
stack traceback:
 /usr/local/share/nvim/runtime/lua/vim/filetype/detect.lua:1248: in 
function 'ft'
 vim/filetype.lua:2362: in function 'dispatch'
 vim/filetype.lua:2522: in function 'match'
 /usr/local/share/nvim/runtime/filetype.lua:12: in function


Has anyone encountered this? (perhaps it has been fixed upstream?)

looks like some wrong alias elsewhere ... add

local format = string.format

before that error line

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] (any) neovim users?

2022-10-14 Thread Alan Braslau via ntg-context
On Fri, 14 Oct 2022 18:59:24 - (UTC)
Nicola via ntg-context  wrote:

> Yours is a valid concern, but maintaining (Neo)Vim plugins is
> a community effort. I took over the development of the ConTeXt plugin
> because I wanted to improve the support for ConTeXt in Vim, and at the
> time the plugin had no active maintainer. In the same way, an
> unsatisfied user might take over the development of a ConTeXt plugin
> for NeoVim, or maybe even for both systems. Anyone can submit a
> patch, and I would welcome a co-maintainer, or even someone who would
> like to take over. I alone simply do not have enough capacity to wet
> my feet in two rivers.
> 
> Indeed, if you or someone reading this would like to steer the
> direction of future development of those plugins, let me know!

I thank you and any/everyone in the community who contributes in an
way, and of course my question was not meant as a critique of any tool
or package or plugin.


In fact, I do *not* use any plugin functionality such as async
typesetting. I do find syntax (color) highlighting helpful, sometimes
(when it works ;-) It generally presently has many problems.

Neovim integrates a lua parser. Unfortunately, I believe that it is
still lua 5.1. Nevertheless, it could possibly benefit from the
(maintained) lpeg Context syntax parser.

Getting an error message now with %@context is annoying. Hopefully,
somebody on this mailing list may know and care something about this.

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] (any) neovim users?

2022-10-14 Thread Alan Braslau via ntg-context
On Fri, 14 Oct 2022 18:59:24 - (UTC)
Nicola via ntg-context  wrote:

> > I wonder why a lua error is reported?  
> 
> Sorry, I should have said that I am only *assuming* that what I wrote
> may be the reason for the error. In fact, I have now tried to open
> a file starting with %, and I get no error. This with NeoVim
> v0.7.2.

The error has appeared with neovim v.0.8.0.

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] (any) neovim users?

2022-10-14 Thread Henning Hraban Ramm via ntg-context

Isn’t the tree-sitter parser enough for syntax highlighting in NeoVim?
https://wiki.contextgarden.net/pm39_tree_sitter_parser
https://github.com/pmazaitis/tree-sitter-context_en

(I don’t use either and can’t help further.)

Hraban


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] (any) neovim users?

2022-10-14 Thread Nicola via ntg-context
On 2022-10-14, Alan Braslau via ntg-context  wrote:
> On Fri, 14 Oct 2022 16:48:42 - (UTC)
> Nicola via ntg-context  wrote:
>
>> On 2022-10-14, Alan Braslau via ntg-context 
>> wrote:
>> > A recent upgrade of the editor neovim leads to the following error
>> > when using % identification at the head of .tex source
>> > files.
>>
>> The ConTeXt plugin (as well as MetaPost and MetaFont ones) has
>> recently been rewritten in Vim 9 script (the new scripting language
>> embedded in Vim), which NeoVim does not support, afaik. See this
>> thread: https://github.com/vim/vim/issues/10968.
>>
>> One thing you can do is: grab the old runtime files and put them in
>> you own ~/.vim directory (following a similar layout). You may get
>> those from the `runtime` folder of the Vim project:
>> https://github.com/vim/vim, or from NeoVim repo. Just checkout
>> a revision with the old scripts (searching for "update runtime" in the
>> commit logs should help you filter the relevant commits).
>>
>> Nicola
>
> Thank you,
>
> I wonder why a lua error is reported?

Sorry, I should have said that I am only *assuming* that what I wrote
may be the reason for the error. In fact, I have now tried to open
a file starting with %, and I get no error. This with NeoVim
v0.7.2.

> I also worry that %@context support has now diverged (for whatever
> reason) and that Context highlighting is now limited to the one "vim"
> variant of the vi editor. Using old runtime files in one's personal
> .vim directory locks one into unmaintained (by the Context community)
> syntax. I wish that a better solution were available.

I am the current maintainer of the ConTeXt/MetaPost/METAFONT plugins.
I do not use NeoVim, and maintaining a plugin compatible with both
systems would be too much of a headache (I know because I have tried
with other plugins). I think that the ConTeXt plugin was not fully
functional in NeoVim even before switch to Vim 9 script (async
typesetting was based on Vim API and, last time I checked, NeoVim had an
incompatible API).

Switching to Vim 9 script has many advantages, as Bram has explained in
the thread I have linked to. So, I believe that it is only natural that
Vim's runtime will gradually move towards Vim 9 script.

Yours is a valid concern, but maintaining (Neo)Vim plugins is
a community effort. I took over the development of the ConTeXt plugin
because I wanted to improve the support for ConTeXt in Vim, and at the
time the plugin had no active maintainer. In the same way, an
unsatisfied user might take over the development of a ConTeXt plugin for
NeoVim, or maybe even for both systems. Anyone can submit a patch, and
I would welcome a co-maintainer, or even someone who would like to take
over. I alone simply do not have enough capacity to wet my feet in two
rivers.

Indeed, if you or someone reading this would like to steer the direction
of future development of those plugins, let me know!

Nicola

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] (any) neovim users?

2022-10-14 Thread Alan Braslau via ntg-context
On Fri, 14 Oct 2022 16:48:42 - (UTC)
Nicola via ntg-context  wrote:

> On 2022-10-14, Alan Braslau via ntg-context 
> wrote:
> > A recent upgrade of the editor neovim leads to the following error
> > when using % identification at the head of .tex source
> > files.  
> 
> The ConTeXt plugin (as well as MetaPost and MetaFont ones) has
> recently been rewritten in Vim 9 script (the new scripting language
> embedded in Vim), which NeoVim does not support, afaik. See this
> thread: https://github.com/vim/vim/issues/10968.
> 
> One thing you can do is: grab the old runtime files and put them in
> you own ~/.vim directory (following a similar layout). You may get
> those from the `runtime` folder of the Vim project:
> https://github.com/vim/vim, or from NeoVim repo. Just checkout
> a revision with the old scripts (searching for "update runtime" in the
> commit logs should help you filter the relevant commits).
> 
> Nicola

Thank you,

I wonder why a lua error is reported?

I also worry that %@context support has now diverged (for whatever reason) and 
that Context highlighting is now limited to the one "vim" variant of the vi 
editor. Using old runtime files in one's personal .vim directory locks one into 
unmaintained (by the Context community) syntax. I wish that a better solution 
were available.

Beyond this, I would think that neovim with lua scripting would be greatly 
preferable to vim9scripting. Indeed, while I do not know anything about the 
details, perhaps it could even use the same lpeg code as developed for the 
Scite editor.

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] (any) neovim users?

2022-10-14 Thread Nicola via ntg-context
On 2022-10-14, Alan Braslau via ntg-context  wrote:
> A recent upgrade of the editor neovim leads to the following error
> when using % identification at the head of .tex source files.

The ConTeXt plugin (as well as MetaPost and MetaFont ones) has recently
been rewritten in Vim 9 script (the new scripting language embedded in
Vim), which NeoVim does not support, afaik. See this thread:
https://github.com/vim/vim/issues/10968.

One thing you can do is: grab the old runtime files and put them in you
own ~/.vim directory (following a similar layout). You may get those
from the `runtime` folder of the Vim project:
https://github.com/vim/vim, or from NeoVim repo. Just checkout
a revision with the old scripts (searching for "update runtime" in the
commit logs should help you filter the relevant commits).

Nicola

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___