[NTG-context] issue in Lua syntax formatting

Max Chernoff mseven at telus.net
Wed Jun 1 02:39:27 CEST 2022


> the formatting of Lua multi-line strings messes up the source structure, 
> in the following MWE, the "one" is displayed after "[[":
> 
> \starttext
> 
> \startLUA
> words = [[
>    one
>    two
>    three
> ]]
> \stopLUA
> 
> \stoptext

I can reproduce this. As a workaround, you can insert a non-breaking 
space (U+00A0) immediately after the "[[":

     \starttext

     \startLUA
     words = [[
     one
     two
     three
     ]]
     \stopLUA

     \stoptext

(You can't see the NBSP, but it's there)

You can also use the Scite syntax highlighting:

     \usemodule[scite]

     \starttext

     \startLUA
     words = [[
     one
     two
     three
     ]]
     \stopLUA

     \stoptext

It produces different (but usually better) output than the default 
highlighter. This module is installed by default with ConTeXt LMTX.

There's also the Vim module:

     \usemodule[vim]
     \definevimtyping[LUA][syntax=lua]

     \starttext

     \startLUA
     words = [[
     one
     two
     three
     ]]
     \stopLUA

     \stoptext

You would need to install this module manually though.

-- Max



More information about the ntg-context mailing list