Skip to content

Commit 0bca4a0

Browse files
authored
runtime(context): update ConTeXt keywords and other minor fixes (#13778)
Update to the ConTeXt runtime files. Changes: 1. shared syntax files updated with `mtxrun --script interface --vim` using the latest ConTeXt LMTX. 2. fixed reference to `make` tag in the help file. 3. added `keepend` to mitigate issues with embedded Lua syntax (see below). 4. the latest revision date of each ConTeXt runtime file has been updated to the date of this commit. The issue about embedded Lua was reported by a user: >Take the following valid ConTeXt file: > \starttext > \ctxlua{context("Text generated from Lua.")} > \ctxlua{context("Another text generated from Lua.")} > \stoptext >On my Vim installation (including when I start Vim with `--clean`), the >closing bracket and curly braces on line 2 are highlighted red and the >syntax highlighting after that is off. >I was trying to dig a little bit into what was going on, using the >`synID()` and `synIDattr()` functions. It appears that the closing >bracket on line 2 is matched as a `luaParentError` instead of the end >of the `luaParen` region. Therefore, the `luaParen` region continues >all the way to the end of the file. The closing curly brace on line >2 is matched as a `luaError`, the 2nd `\ctxlua` on line 3 as >`luaParen`, etc. >This issue doesn't occur in a plain Lua file, where the closing bracket >is correctly matched as the end of the `luaParen` region. So it seems >that something goes wrong when the Lua syntax file is included in the >ConTeXt one. By adding `keepend`, the right parenthesis for some reason is still highlighted as a `luaParenError`, but at least the right curly brace should correctly end the Lua block. From what I've seen, I think it is very difficult to embed Lua syntax properly without help from the Lua syntax file (that is, without patching it). It has global rules such as: syn match luaParenError ")" syn match luaError "}" which make it difficult, if not impossible, to contain Lua syntax without `keepend` (and its limitations). Signed-off-by: Lifepillar <lifepillar@lifepillar.me> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent cea3dac commit 0bca4a0

10 files changed

Lines changed: 1603 additions & 1581 deletions

File tree

runtime/autoload/context.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Language: ConTeXt typesetting engine
44
# Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
55
# Former Maintainers: Nikolai Weibull <now@bitwi.se>
6-
# Latest Revision: 2022 Sep 19
6+
# Latest Revision: 2023 Dec 26
77

88
# Typesetting {{{
99
import autoload './typeset.vim'

runtime/compiler/context.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Language: ConTeXt typesetting engine
44
# Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
55
# Former Maintainers: Nikolai Weibull <now@bitwi.se>
6-
# Latest Revision: 2022 Aug 12
6+
# Latest Revision: 2023 Dec 26
77

88
if exists("g:current_compiler")
99
finish

runtime/doc/ft_context.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*ft_context.txt* For Vim version 9.0. Last change: 2022 Sep 27
1+
*ft_context.txt* For Vim version 9.0. Last change: 2023 Dec 26
22

33
This is the documentation for the ConTeXt filetype plugin.
44

@@ -103,13 +103,13 @@ Stop all the ConTeXt jobs currently running in the background.
103103
Settings ~
104104
*'b:context_ignore_makefile'*
105105
*'g:context_ignore_makefile'*
106-
`:make` can be used to (synchronously) typeset a document. If a Makefile exists
106+
|make| can be used to (synchronously) typeset a document. If a Makefile exists
107107
and this option is not set, standard `make` is used. If this option is set,
108108
`mtxrun` is invoked instead, even if a Makefile exists.
109109
>
110110
g:context_ignore_makefile = 0
111111
<
112-
NOTE: before using `:make`, set the working directory of the buffer to the
112+
NOTE: before using |make|, set the working directory of the buffer to the
113113
directory of the file to be typeset.
114114

115115
*'g:context_extra_options'*

runtime/ftplugin/context.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vim9script
44
# Language: ConTeXt typesetting engine
55
# Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
66
# Former Maintainers: Nikolai Weibull <now@bitwi.se>
7-
# Latest Revision: 2022 Aug 12
7+
# Latest Revision: 2023 Dec 26
88

99
if exists("b:did_ftplugin")
1010
finish

runtime/indent/context.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Language: ConTeXt typesetting engine
44
# Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
55
# Former Maintainers: Nikolai Weibull <now@bitwi.se>
6-
# Latest Revision: 2022 Aug 12
6+
# Latest Revision: 2023 Dec 26
77

88
if exists("b:did_indent")
99
finish

runtime/syntax/context.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ vim9script
44
# Language: ConTeXt typesetting engine
55
# Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
66
# Former Maintainers: Nikolai Weibull <now@bitwi.se>
7-
# Latest Revision: 2022 Aug 12
7+
# Latest Revision: 2023 Dec 26
88

99
if exists("b:current_syntax")
1010
finish
@@ -90,7 +90,7 @@ syn match contextDirectLua "\\\%(directlua\|ctxlua\)\>\%(\s*%.*$\)\="
9090
\ nextgroup=contextBeginEndLua skipwhite skipempty
9191
\ contains=contextComment
9292
syn region contextBeginEndLua matchgroup=contextSpecial
93-
\ start="{" end="}" skip="\\[{}]"
93+
\ start="{" end="}" skip="\\[{}]" keepend
9494
\ contained contains=@luaTop,@NoSpell
9595

9696
for synname in keys(context_include)

runtime/syntax/shared/context-data-context.vim

Lines changed: 284 additions & 289 deletions
Large diffs are not rendered by default.

runtime/syntax/shared/context-data-interfaces.vim

Lines changed: 1110 additions & 1108 deletions
Large diffs are not rendered by default.

runtime/syntax/shared/context-data-metafun.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ vim9script
22

33
# Vim syntax file
44
# Language: ConTeXt
5-
# Automatically generated by mtx-interface (2022-08-12 10:49)
5+
# Automatically generated by mtx-interface (2023-12-26 16:40)
66

77
syn keyword metafunCommands loadfile loadimage loadmodule dispose nothing
88
syn keyword metafunCommands transparency tolist topath tocycle sqr
@@ -97,7 +97,7 @@ syn keyword metafunCommands mpvard mpvarn mpvars mpvar withtolerance
9797
syn keyword metafunCommands hatched withdashes processpath pencilled sortedintersectiontimes
9898
syn keyword metafunCommands intersectionpath firstintersectionpath secondintersectionpath intersectionsfound cutbeforefirst
9999
syn keyword metafunCommands cutafterfirst cutbeforelast cutafterlast xnormalized ynormalized
100-
syn keyword metafunCommands xynormalized phantom scrutinized
100+
syn keyword metafunCommands xynormalized phantom scrutinized xshifted yshifted
101101
syn keyword metafunInternals nocolormodel greycolormodel graycolormodel rgbcolormodel cmykcolormodel
102102
syn keyword metafunInternals shadefactor shadeoffset textextoffset textextanchor normaltransparent
103103
syn keyword metafunInternals multiplytransparent screentransparent overlaytransparent softlighttransparent hardlighttransparent
@@ -114,4 +114,4 @@ syn keyword metafunInternals getrecord cntrecord anchorxy anchorx anchory
114114
syn keyword metafunInternals anchorht anchordp anchorul anchorll anchorlr
115115
syn keyword metafunInternals anchorur localanchorbox localanchorcell localanchorspan anchorbox
116116
syn keyword metafunInternals anchorcell anchorspan matrixbox matrixcell matrixspan
117-
syn keyword metafunInternals pensilcolor pensilstep
117+
syn keyword metafunInternals pensilcolor pensilstep uu

0 commit comments

Comments
 (0)