ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* issue in Lua syntax formatting
@ 2022-05-30 11:01 Henning Hraban Ramm via ntg-context
  2022-06-01  0:39 ` Max Chernoff via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-05-30 11:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Henning Hraban Ramm

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

(Denis recognized that in his MAPS/CGJ article on ligature handling.)

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

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

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

* Re: issue in Lua syntax formatting
  2022-05-30 11:01 issue in Lua syntax formatting Henning Hraban Ramm via ntg-context
@ 2022-06-01  0:39 ` Max Chernoff via ntg-context
  2022-06-01  7:33   ` Henning Hraban Ramm via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Max Chernoff via ntg-context @ 2022-06-01  0:39 UTC (permalink / raw)
  To: ntg-context; +Cc: Max Chernoff

> 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

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

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

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

* Re: issue in Lua syntax formatting
  2022-06-01  0:39 ` Max Chernoff via ntg-context
@ 2022-06-01  7:33   ` Henning Hraban Ramm via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2022-06-01  7:33 UTC (permalink / raw)
  To: ntg-context; +Cc: Henning Hraban Ramm

Am 01.06.22 um 02:39 schrieb Max Chernoff:
>> the formatting of Lua multi-line strings messes up the source 
>> structure, in the following MWE, the "one" is displayed after "[[":
> 
> I can reproduce this. As a workaround, you can insert a non-breaking 
> space (U+00A0) immediately after the "[[":

Good idea, but I’d like to avoid invisible tweaks.

> You can also use the Scite syntax highlighting:
> 
>      \usemodule[scite]

Thank you for the reminder!

Since I need it for the CG journal, I wanted to avoid additional 
dependencies, but the scite module is part of the distribution anyway 
and works as a drop-in replacement.

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

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

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

end of thread, other threads:[~2022-06-01  7:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 11:01 issue in Lua syntax formatting Henning Hraban Ramm via ntg-context
2022-06-01  0:39 ` Max Chernoff via ntg-context
2022-06-01  7:33   ` Henning Hraban Ramm via ntg-context

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