summaryrefslogtreecommitdiffstats
path: root/runtime/syntax
AgeCommit message (Collapse)Author
2024-03-05runtime(c): Recognize "__inline" (#14145)Wu Yongwei
`__inline` is recognized by GCC, and may even be preferred, as MSVC does not recognize `__inline__`. Signed-off-by: Wu Yongwei <wuyongwei@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-04runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (#14137)dkearns
* runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups - Remove contained :syntax and :highlight sub-groups from the function body cluster. These should only match in the respective commands. - Remove vimSynLine syntax group from several clusters. The definition of vimSynLine was removed in Vim 5.3. * runtime(vim): Update syntax generator, use standard Last Change date format The de facto standard date format is YYYY MMM DD. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-04runtime(sh): Update syntax file, fix issue #962 (#14138)dkearns
Allow the opening parenthesis of a multiline array assignment, within an if statement, to appear at EOL. Fixes issue #962. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-04runtime(css): update syntax scriptJay Sitter
Signed-off-by: Jay Sitter <jay@jaysitter.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(vim): Update base-syntax, fix issue #14135 (#14136)dkearns
Fix incorrect error highlighting for function calls in :command definitions. vimFunctionError should be restricted to :function header lines. fixes: #14135 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(vim): Update base-syntax, improve :augroup highlighting (#14125)dkearns
- Explicitly match the bang and group name in :aug! {name}. - Allow any characters in a group name. - Match default group switch marker, END. - Match :aug without arguments (list command). Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-03runtime(java): Recognise text blocks (#14128)Aliaksei Budavei
Also, accept as valid the space escape sequence `\s`. Also, consistently use the claimed `javaDebug` prefix for syntax group definitions kept under `g:java_highlight_debug`. Since `javaStringError` is commented out for its generality, let's comment out `javaDebugStringError`, its copy, as well. References: https://openjdk.org/jeps/378 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7 Closes #10910. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-01runtime(java): Improve the recognition of literals (#14120)Aliaksei Budavei
* Emend the Unicode and octal escape sequence patterns; * Accept the (repeated) underscore separators in all numerical literals; * Recognise hexadecimal floating-point literals. (The space escape sequence '\s' will be introduced along with text blocks in another PR.) References: https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.3 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.1 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.2 https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28runtime(java): Recognise _when_ clauses in _switch_ blocksAliaksei Budavei
Also: - distinguish _yield_ when used as a contextual keyword from when used qualified as a method or a method reference (as can be seen in testdir/input/java_switch.java, variables and method declarations named _yield_ will be recognised as the namesake keyword--consider picking other names for variables, and defining g:java_highlight_functions to have method names painted; since _yield_ statements can have trailing parens, they must be recognised as statements, for only qualified _yield_ method calls are supported); - recognise grouped _default_ _case_ labels; - describe primitive types for _case_ labels (JLS, §14.11, §3.10.1); - recognise some non-ASCII identifiers (see javaLambdaDef, javaUserLabel) (further improvement for better recognition of identifiers will be arranged in a separate PR). Because the arrow '->' is used in two kinds of expressions, lambda (abstractions) and _switch_, necessary changes were made for the recognition of either (and further improvement touching lambda expressions will be separately arranged). Because 'default' is used for instance method declarations in interfaces and in _switch_ labels, necessary changes were made for the recognition of either (and further improvement touching method declarations will be separately arranged). Finally, it deemed appropriate to put 'yield' in the syntax group of javaOperator rather than javaStatement, for its member 'var' is also another contextual keyword (e.g., this is valid syntax: "var var = var(test.var);"). References: https://openjdk.org/jeps/361 (Switch Expressions) https://openjdk.org/jeps/440 (Record Patterns) https://openjdk.org/jeps/441 (Pattern Matching for switch) Also, add a Java specific filetype plugin for the syntax test, so that no soft-wrapping of long indented lines occur. Otherwise the syntax scripts would miss a few lines during scrolling and verification of the screen dumps. closes: #14105 Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28runtime(syntax-tests): simplify code and allow filetype optionsChristian Brabandt
The whole testdir/runtest.vim is a bit of a mess. So this is an attempt to improving the current state. First of all, let's move most of the code into a single RunTest() function so that it's easier to run this manually. Then, let's add the possibility to customize filetype specific tests by applying filetype specific options. We will make use of it in the next commit, where the provided java file uses tabs, which cause line wrapping which will then cause the scrolling to miss some lines when redrawing (see #14105) related: #14105 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-27runtime(vim): Update base-syntax, improve :echo highlighting (#14103)dkearns
- Normalise behaviour of :echo commands and improve expression matching. - Allow continued argument lines. - Refine string interpolation groups. - Remove duplicated :menu and :map generated commands that are handled specially later in the file. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-27runtime(debian): update Debian syntax files (#14098)James McCoy
* debversions.vim: Move lunar to unsupported release * debsources: Add word boundaries around keyword match patterns Co-authored-by: James Addison <jay@jp-hosting.net> Signed-off-by: James Addison <jay@jp-hosting.net> Signed-off-by: James McCoy <jamessan@jamessan.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-26runtime(vim): Update syntax file, improve :substitute matching (#14093)dkearns
- Differentiate between :substitute and substitute(), fixes #13883. - Match all allowed :substitute delimiters. - Remove leading context from :substitute matches. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22runtime(spec): Recognize SourceLicense tag name in RPM spec syntax (#14046)Petr Pisar
rpm-4.19.0 added a new SourceLicense tag. It is used at the same place as License tag. This patch adds the new tag name into a Vim syntax file to be highligted the same way as the License tag. Note that it has to be defined in the syntax file before Source\d* regexp. Otherwise it's not recognized by Vim. Signed-off-by: Petr Písař <ppisar@redhat.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22runtime(vim): Update base-syntax, fix :unabbrev highlighting (#14077)dkearns
Fixes issue #7876 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-22runtime(java): add syntax support for Java switch expressions (#9124)Nick Hanley
Signed-off-by: Nick Hanley <nicholasjhanley@gmail.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21patch 9.1.0122: Some minor issues with the getregion() functionv9.1.0122Maxim Kim
Problem: Some minor issues with the getregion() function Solution: Fix examples in the help, use OP_NOP op_type and MBLOCK as motion_type in f_getreg(), update vim syntax to for getregion() (Maxim Kim) ``` :xnoremap <CR> \ <Cmd>echow getregion('v', '.', mode())<CR> ``` `echo` while in visual mode has no visible effect, thus people trying example might be frustrated as it looks like nothing happens. So the option is to change it to `echow` or `echom`. With `echom` it is again has no visible effect but one can at least inspect `:messages`. On the other hand `echow` showes selected text in a popup window. ``` Can also be used as a |method|: > '.'->getregion("'a', 'v') ``` Here is the typo, which makes example invalid, should be `("'a", ...` closes: #14064 Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21runtime(tmux): Update tmux syntax (#14065)Eric Pruitt
Signed-off-by: Eric Pruitt <eric.pruitt@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-19runtime(misc): announce adoption of various runtime filesChristian Brabandt
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-18runtime(vim): Distinguish Vim9 constructor definitions from the :new ex ↵Aliaksei Budavei
command (#14050) With the arrival of Vim9 classes, the syntax must allow for _new_ constructors; multiple constructor definitions are supported for a class, provided distinct suffix-names are used. Currently, the defined constructors match either vimCommand or vimFunctionError (for any newBar). For example: ------------------------------------------------------------ vim9script class Foo def new() enddef def newBar() enddef endclass ------------------------------------------------------------ Since every constructor is required to bear a lower-cased _new_ prefix name, it should suffice to distinguish them from functions, and so there are no new highlight or syntax groups introduced. Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com> Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-14runtime(vim): Update base-syntax, remove unused vimString regionDoug Kearns
These were included with the initial release of the syntax file for Vim 5 and were probably intended to allow for syn-region start/skip/end patterns with a '!' or '+' delimiter. However, these cases are currently handled by the vimSynRegPat group. The removed patterns never match anywhere in the distributed runtime files and it is believed that this is generally true. closes: #14035 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-14runtime(vim): Update base-syntax, fix :behave highlightingDoug Kearns
closes: #14036 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-14runtime(vim): update Vim Syntax generatorh-east
- Add missing "Last Change:" line. - The date on this line in vim.vim is updated by update_date.vim at Make time. (I made a mistake in the file path) - Remove unnecessary "b:loaded_syntax_vim_ex". - Remove "Base File Date:" line in vim.vim.base - Add Doug Kearns as Maintainer closes: #14031 Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-13runtime(vim): include Vim Syntax generatorh-east
fixes: #13939 closes: #14021 related: vim-jp/syntax-vim-ex#28 Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-11runtime(gpg): Mark dangerous use-embedded-filename with WarningMsgChristian Brabandt
The syntax highlighter is likely to encourage people to use the listed commands. But `use-embedded-filename` is a dangerous option that can cause GnuPG to write arbitrary data to arbitrary files whenever GnuPG encounters malicious data. GnuPG upstream explicitly warns against using this option: https://dev.gnupg.org/T4500 https://dev.gnupg.org/T6972 However, since this is a valid option, we cannot just drop it from the syntax script. Instead, let's mark it with the WarningMsg highlighting to make it obvious, that this option is different (and should not be used for security reasons). closes: #13961 Co-authored-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-11runtime(vim): Update syntax file (#14009)dkearns
- allow comments after :highight commands - match the bang in a :highlight[!] command - highlight the bang in :map[!], :menu[!] and :unlet[!] with vimOper like all other commands Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-10patch 9.1.0091: Syntax test fails when run with non C localev9.1.0091Christian Brabandt
Problem: Syntax test fails when run with non C locale Solution: Run syntax tests with C locale, clean up Xtestscript file, strip environment variables from GetVimCommand() (h-east) closes: #14007 Co-authored-by: h-east <h.east.727@gmail.com> Signed-off-by: h-east <h.east.727@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-06runtime(dosbatch): improve '::' comment highlightingChristian Brabandt
Added a syntax region for command blocks so that the highlighting of `::` comments in them can be controlled. The `dosbatch_colons_comment` variable now controls if all `::` comments in a code block are highlighted as comments or errors. A `::` comment at the end of a command block is always highlighted as an error. This re-enables the highlighting of `::` comments in `.bat` files as requested in #13666, while allowing control of highlighting them in command blocks requested in #11778 and first attempted in #11980. related: #11980 fixes: #13666 Co-authored-by: Mike Williams <mikew@globalgraphics.com> Signed-off-by: Mike Williams <mikew@globalgraphics.com> Signed-off-by: mevanlc <mevanlc@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-03runtime(vim): Update syntax file (#13969)dkearns
Improve string interpolation highlighting. Use the vimSep group to highlight interpolation braces as vimOperParen has no highlighting of its own and employs vimSep via matchgroup. Add vimNumber to the interpolation group's contained list. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: thinca <thinca@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-01runtime(vim): Update syntax file (#13948)dkearns
Improve string escape sequence and special key matching. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-01runtime(fortran): update syntax (#13953)Ajit-Thakkar
* runtime (Fortran) update syntax * runtime (Fortran) small fix Signed-off-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-28patch 9.1.0060: Recorded register cannot be translated using keytrans()v9.1.0060zeertzjq
Problem: Recorded register cannot be translated using keytrans() when it involves character search (iddqd505) Solution: Record a K_IGNORE instead of a K_NOP (zeertzjq) related: #13916 closes: #13925 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-28runtime(vim): Highlight string interpolationthinca
closes: #13923 Signed-off-by: thinca <thinca@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-28runtime(vim): Update syntax and ftplugin files (#13924)dkearns
Improve matching of line-continuations and interspersed comments. These are now also matched in multiline syntax command patterns, dictionary literals, and parenthesised expressions and argument lists. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-27runtime(ant): Update syntax file (#13926)dkearns
Remove invalid display option from syn-keyword commands. Take over maintenance of this file. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-27runtime(vim): Update syntax file (#13919)dkearns
Add foreach() function. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-25patch 9.1.0059: No event triggered before creating a windowv9.1.0059Sergey Vlasov
Problem: No event is triggered before creating a window. (Sergey Vlasov) Solution: Add the WinNewPre event (Sergey Vlasov) fixes: #10635 closes: #12761 Signed-off-by: Sergey Vlasov <sergey@vlasov.me> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-25runtime(mail): fix #13913 (#13917)gi1242
switch to the DFA engine for the emoji collaction range Co-authored-by: GI <gi1242+vim@gmail.com> Signed-off-by: GI <gi1242@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-24runtime(fortran): update syntax and documentation (#13912)Ajit-Thakkar
* runtime (doc): update Fortran section * runtime(syntax): Complete support for Fortran 2023. Minor improvements. Signed-off-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-23runtime(c): Highlight user defined functionsLuca Saccarola
closes: #13763 Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-23runtime(vim): Update syntax file (#13906)dkearns
Highlight :2match and :3match and add these to :help ex-cmd-index. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-23runtime(mail): updated syntax fileGI
Signed-off-by: GI <gi1242@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-22runtime(sh): Add handling for ksh93 shared-state comsubs and mksh valsubs ↵Johnothan King
(#13884) This commit adds support for ksh93 shared-state command substitutions (syntax: ${ command; }) and mksh's value substitutions (syntax: ${|command;}) in the sh syntax script. Also add a syntax test for ksh subshares with dumps included to make sure it doesn't regress. fixes: #9514 Signed-off-by: Johnothan King <johnothanking@protonmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-22runtime(chuck): include ChucK syntax file (#13895)Andrea C from The App
Co-authored-by: gacallea <gacallea@users.noreply.github.com> Signed-off-by: gacallea <gacallea@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-22runtime(go): update Go syntax file (#13896)Billie Cleek
Update the Go syntax file with some recent changes made to vim-go. Signed-off-by: Billie Cleek <bhcleek@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-17runtime(swayconfig): add focus_follows_mouse and smart_qaps syntax keywordsJames Eapen
See: https://github.com/swaywm/sway/blob/0aceff74696f03d306dc9de5473d9ed7afb73f67/sway/sway.5.scd?plain=1#L680 `focus_follows_mouse yes|no|always` https://github.com/swaywm/sway/blob/0aceff74696f03d306dc9de5473d9ed7afb73f67/sway/sway.5.scd?plain=1#L770 closes: #13797 Signed-off-by: James Eapen <james.eapen@vai.org><author> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-17runtime(i3config): remove always from `focus_follows_mouse`James Eapen
The always option does not exist in i3, only sway. From https://i3wm.org/docs/userguide.html: `focus_follows_mouse yes|no` Version number incremented by 2 because the last commit did not increment the version. Signed-off-by: James Eapen <james.eapen@vai.org> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-16runtime(odin): include ftplugin, syntax and indent script (#13867)Maxim Kim
Note for Neovim Contributors: this is bundled as Vim9 Script. If you want to use this on Neovim, you need to convert the Vim9 scripts to Vim Script or Lua or leave it out. Signed-off-by: Maxim Kim <habamax@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-15runtime(fortran): update fortran syntax (#13870)Ajit-Thakkar
Support most remaining features of Fortran 2018/2023 Small improvements to folding etc, Code cleanup: use \? instead of mix of \= and \? Signed-off-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-15patch 9.1.0030: Cannot use terminal alternate fontv9.1.0030PMunch
Problem: Cannot use terminal alternate fonts (PMunch) Solution: Support terminal alternate fonts using CSI SGR 10-20 and t_CF code (PMunch) Add support for alternate font highlighting This adds support for alternate font highlighting using CSI SGR 10-20. Few terminals currently support this, but with added tool support this should improve over time. The change here is more or less taken from how colors are configured and applied, but there might be some parts I missed while implementing it. Changing fonts is done through the new `:hi ctermfont` attribute which takes a number, 0 is the normal font, and the numbers 1-9 select an "alternative" font. Which fonts are in use is up to the terminal. fixes: #13513 closes: #13537 Signed-off-by: PMunch <peterme@peterme.net> Signed-off-by: Christian Brabandt <cb@256bit.org>