1
0
forked from aniani/vim
Lifepillar 0bca4a0018
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>
2023-12-27 18:49:50 +01:00
..
2023-08-10 06:19:18 +02:00
2022-04-08 17:45:08 +01:00
2017-03-05 17:04:09 +01:00
2022-04-08 17:45:08 +01:00
2022-01-29 22:20:48 +00:00
2022-07-25 15:42:07 +01:00
2022-03-19 15:18:53 +00:00
2021-07-28 20:10:16 +02:00
2023-10-16 09:53:37 +02:00
2022-04-08 17:45:08 +01:00
2022-09-27 17:30:34 +01:00
2022-03-30 10:51:39 +01:00
2021-10-04 21:32:54 +01:00
2021-10-04 21:32:54 +01:00
2022-06-09 20:45:54 +01:00
2021-10-04 21:32:54 +01:00
2017-06-13 18:12:01 +02:00
2022-04-08 17:45:08 +01:00
2022-04-08 17:45:08 +01:00
2022-04-08 17:45:08 +01:00
2017-03-05 17:04:09 +01:00
2021-10-23 12:08:41 +01:00
2022-06-17 15:42:40 +01:00
2023-05-14 18:50:25 +01:00
2022-04-08 17:45:08 +01:00
2017-03-16 17:41:02 +01:00
2021-10-04 21:32:54 +01:00
2023-10-16 09:53:37 +02:00
2019-01-17 16:07:22 +01:00
2021-10-04 21:32:54 +01:00
2022-07-25 15:42:07 +01:00
2022-04-08 17:45:08 +01:00
2022-04-27 15:25:03 +01:00
2021-10-04 21:32:54 +01:00
2022-01-29 22:20:48 +00:00
2022-08-30 20:26:34 +01:00
2017-06-13 18:12:01 +02:00
2022-04-08 17:45:08 +01:00
2022-09-27 17:30:34 +01:00
2022-03-19 15:18:53 +00:00
2021-10-16 15:23:36 +01:00
2017-06-13 18:12:01 +02:00
2022-04-08 17:45:08 +01:00
2017-06-13 18:12:01 +02:00
2019-11-17 15:55:14 +01:00
2017-03-16 17:41:02 +01:00
2022-07-29 21:36:21 +01:00
2022-09-10 13:13:14 +01:00
2023-10-16 09:53:37 +02:00
2023-10-16 09:53:37 +02:00
2021-10-04 21:32:54 +01:00
2021-09-09 21:55:11 +02:00
2022-03-19 15:18:53 +00:00
2022-08-08 15:42:38 +01:00
2023-04-22 22:40:14 +01:00
2023-05-14 18:50:25 +01:00
2022-04-08 17:45:08 +01:00
2020-07-10 22:00:53 +02:00
2021-10-04 21:32:54 +01:00
2021-11-07 20:27:04 +00:00
2022-08-26 18:01:12 +01:00
2022-04-08 17:45:08 +01:00
2022-08-26 18:01:12 +01:00
2022-12-31 15:30:45 +00:00
2023-08-23 21:20:00 +02:00
2022-04-08 17:45:08 +01:00
2022-11-23 23:46:31 +00:00
2022-04-08 17:45:08 +01:00
2021-10-04 21:32:54 +01:00
2022-05-21 13:08:16 +01:00
2022-04-27 15:25:03 +01:00
2022-04-08 17:45:08 +01:00
2021-04-07 21:07:20 +02:00
2022-01-29 22:20:48 +00:00
2023-02-27 15:49:53 +00:00
2018-11-04 14:45:49 +01:00
2023-10-16 09:53:37 +02:00
2021-10-04 21:32:54 +01:00
2023-04-22 22:40:14 +01:00
2023-02-27 15:49:53 +00:00
2023-04-22 22:40:14 +01:00
2020-10-26 21:12:46 +01:00
2023-02-27 15:49:53 +00:00
2022-04-08 17:45:08 +01:00
2022-03-19 15:18:53 +00:00
2018-02-09 22:00:53 +01:00
2021-10-04 21:32:54 +01:00
2021-12-24 13:18:38 +00:00
2022-04-08 17:45:08 +01:00
2021-10-16 15:23:36 +01:00
2020-05-26 21:20:45 +02:00
2021-10-04 21:32:54 +01:00
2021-10-16 15:23:36 +01:00
2021-10-23 12:08:41 +01:00
2022-04-27 15:25:03 +01:00
2022-04-27 15:25:03 +01:00
2022-04-27 15:25:03 +01:00
2022-12-31 15:30:45 +00:00
2022-12-31 15:30:45 +00:00
2022-04-27 15:25:03 +01:00
2022-04-27 15:25:03 +01:00
2021-12-24 13:18:38 +00:00
2022-04-27 15:25:03 +01:00
2022-09-04 17:45:43 +01:00
2022-12-06 18:20:10 +00:00
2015-06-09 19:44:55 +02:00

This directory contains files to automatically compute the indent for a
type of file.

If you want to add your own indent file for your personal use, read the docs
at ":help indent-expression".  Looking at the existing files should give you
inspiration.

If you make a new indent file which would be useful for others, please send it
to the vim-dev mailing list <vim-dev@vim.org>.  Include instructions for
detecting the file type for this language, by file name extension or by
checking a few lines in the file. And please stick to the rules below.

If you have remarks about an existing file, send them to the maintainer of
that file.  Only when you get no response send a message to the vim-dev
mailing list: <vim-dev@vim.org>.

If you are the maintainer of an indent file and make improvements, e-mail the
new version to the vim-dev mailing list: <vim-dev@vim.org>.


Rules for making an indent file:

You should use this check for "b:did_indent":

	" Only load this indent file when no other was loaded yet.
	if exists("b:did_indent")
	  finish
	endif
	let b:did_indent = 1

Always use ":setlocal" to set 'indentexpr'.  This avoids it being carried over
to other buffers.

To trigger the indenting after typing a word like "endif", add the word to the
'indentkeys' option with "+=".

You normally set 'indentexpr' to evaluate a function and then define that
function.  That function only needs to be defined once for as long as Vim is
running.  Add a test if the function exists and use ":finish", like this:
	if exists("*GetMyIndent")
	  finish
	endif

The user may have several options set unlike you, try to write the file such
that it works with any option settings.  Also be aware of certain features not
being compiled in.

To test the indent file, see testdir/README.txt.