Match :sleep arg properly including a lone "m" with a leading count.
closes: vim/vim#15003262e25e5a1
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Make a formal definition for normal and single-element kinds
of annotations that otherwise require for their containment
to repeat each time all syntax groups that describe element
values.
Reference:
https://docs.oracle.com/javase/specs/jls/se21/html/jls-9.html#jls-9.7902b766858
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
Allow highlighting of strings within comments to be disabled by setting
g:vimsyn_comment_strings to false.
959c3c887b
Co-authored-by: dkearns <dougkearns@gmail.com>
Allow whitespace between the :substitute command and its pattern
argument. Although unusual, it is supported and there are examples in
the wild.
Match Vi compatible :substitute commands like :s\/{string}/. See :help
E1270.
fixes: vim/vim#14920closes: vim/vim#1492392f4e91590
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: no whitespace padding in commentstring option in ftplugins
Solution: Change default to include whitespace padding, update
existing filetype plugins with the new default value
(Riley Bruins)
closes: vim/vim#148430a0830624a
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Problem: filetype: rasi files are not recognized
Solution: regonize '*.rasi' files as rasi filetype,
include a filetype and syntax plugin
(Pierrick Guillaume)
ported from: https://github.com/Fymyte/rasi.vimcloses: vim/vim#14821280e5b13ca
Co-authored-by: Pierrick Guillaume <pierguill@gmail.com>
* Add space in template for 'commentstring'
* Add 'comments' and 'commentstring' support to debcontrol
* debversions: Move Ubuntu releases outside of standard support to unsupported
Although trust, xenial, and bionic are not EOL yet, their standard support period has ended.
Reported-by: Riley Bruins <ribru17@gmail.com>
0076ddc07d
Co-authored-by: James McCoy <jamessan@debian.org>
Co-authored-by: Riley Bruins <ribru17@gmail.com>
- fix floating_modifier $mod normal|inverse was being hightlighted as error
reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier
fixes: vim/vim#14826closes: vim/vim#1482722ac941208
Co-authored-by: James Eapen <james.eapen@vai.org>
Co-authored-by: JosefLitos <litosjos@fit.cvut.cz>
runtime(java): Strive to remain compatible for at least Vim 7.0 (vim/vim#14744)
Also:
- Limit all look-behind regexp patterns.
- Cache regexp capabilities for [:upper:] and [:lower:].
d3952e8cfe
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(java): Stop handpicking syntax groups for @javaTop (vim/vim#14727)
* runtime(java): Stop handpicking syntax groups for @javaTop
Also:
- Remove the obsolete comment for g:java_allow_cpp_keywords.
- Remove the commented out groups java\%[Debug\]StringError.
- Infer and set the preferred formatting Vim options from
the modeline.
Since vim-6-0u, non-contained syntax groups can be referred
to by using the "contains=TOP..." argument.
* Set &encoding and &termencoding to "utf-8" for test files
* Limit non-ASCII charset to [§ƒɐɘʬʭΑ-Τα-μ] for test files
06bdac1580
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(cpp): Fix digit separator in syntax script for octals and floats
Also fix the incorrect rendering of floats that start with ".".
closes: vim/vim#14724c5def6561d
Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
Problem: filetype: stylus files not recognized
Solution: Detect '*.styl' and '*.stylus' as stylus filetype,
include indent, filetype and syntax plugin
(Philip H)
closes: vim/vim#146562d919d2744
Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
runtime(java): Improve the recognition of the "indent" method declarations (vim/vim#14659)
There is a flaw in the current implementation that has been
exacerbated around v5.2. It lies in the recognition of all
three indentation styles simultaneously: a tab, two space,
and eight space character(s). With it, it is not uncommon
to misidentify various constructs as method declarations
when they belong to two-space indented members and other
blocks of a type and are offset at eight space characters or
a tab from the start of the line.
For example,
------------------------------------------------------------
class Test
{
static String hello() { return "hello"; }
public static void main(String[] args)
{
try {
if (args.length > 0) {
// FIXME: eight spaces.
System.out.println(args[0]);
} else {
// FIXME: a tab.
System.out.println(hello());
}
} catch (Exception e) {
throw new Error(e);
}
}
}
------------------------------------------------------------
------------------------------------------------------------
:let g:java_highlight_functions = 'indent'
:doautocmd Syntax
------------------------------------------------------------
A better approach is to pick an only indentation style out
of all supported styles (so either two spaces _or_ eight
spaces _or_ a tab). Note that tabs and spaces can still be
mixed, only the leading tab or the leading run of spaces
matters for the recognition. And there is no reason to not
complement the set of valid styles with any number of spaces
from 1 to 8, inclusively.
Please proceed with the necessary change as follows:
- rename from "indent" to "indent2" for a 2-space run;
- rename from "indent" to "indent8" for an 8-space run;
- continue to have "indent" for a tab run;
- define an "indent" variable with a suffix number denoting
the preferred amount of indentation for any other run of
spaces [1-8].
As before, this alternative style of recognition of method
declarations still does not prescribe naming conventions and
still cannot recognise method declarations in nested types
that are conventionally indented.
The proposed changes also follow suit of "style" in stopping
the claiming of constructor and enum constant declarations.
c4d0c8c812
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(java): Improve the recognition of the "style" method declarations
- Request the new regexp engine (v7.3.970) for [:upper:] and
[:lower:].
- Recognise declarations of in-line annotated methods.
- Recognise declarations of _strictfp_ methods.
- Establish partial order for method modifiers as shown in
the MethodModifier production; namely, _public_ and
friends should be written the leftmost, possibly followed
by _abstract_ or _default_, or possibly followed by other
modifiers.
- Stop looking for parameterisable primitive types (void<?>,
int<Object>, etc., are malformed).
- Stop looking for arrays of _void_.
- Acknowledge the prevailing convention for method names to
begin with a small letter and for class/interface names to
begin with a capital letter; and, therefore, desist from
claiming declarations of enum constants and constructors
with javaFuncDef.
Rationale:
+ Constructor is distinct from method:
* its (overloaded) name is not arbitrary;
* its return type is implicit;
* its _throws_ clause depends on indirect vagaries of
instance (variable) initialisers;
* its invocation makes other constructors of its type
hierarchy invoked one by one, concluding with the
primordial constructor;
* its explicit invocation, via _this_ or _super_, can
only appear as the first statement in a constructor
(not anymore, see JEP 447); else, its _super_ call
cannot appear in constructors of _record_ or _enum_;
and neither invocation is allowed for the primordial
constructor;
* it is not a member of its class, like initialisers,
and is never inherited;
* it is never _abstract_ or _native_.
+ Constructor declarations tend to be few in number and
merit visual recognition from method declarations.
+ Enum constants define a fixed set of type instances
and more resemble class variable initialisers.
Note that the code duplicated for @javaFuncParams is written
keeping in mind for g:java_highlight_functions a pending 3rd
variant, which would require none of the :syn-cluster added
groups.
closes: vim/vim#14620a4c085a3e6
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Problem: runtime(uci): No support for uci file types
(Wu, Zhenyu)
Solution: include basic uci ftplugin and syntax plugins
(Colin Caine)
closes: vim/vim#145754b3fab14db
Co-authored-by: Colin Caine <complaints@cmcaine.co.uk>
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Problem: filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
as requirements filetype, include pip compiler, include
requirements filetype and syntax plugin
(Wu, Zhenyu, @raimon49)
closes: vim/vim#14379f9f5424d3e
Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Co-authored-by: raimon <raimon49@hotmail.com>
runtime(java): Recognise non-ASCII identifiers (vim/vim#14543)
* runtime(java): Recognise non-ASCII identifiers
Also:
- Remove the already commented out and less general in its
definition javaFuncDef alternative.
- Stop recognising some bespoke {p,trace} debugging API.
Non-ASCII identifiers have been supported from the outset
of the Java language.
> An _identifier_ is an unlimited-length sequence of _Java
> letters_ and _Java digits_, the first of which must be a
> Java letter. An identifier cannot have the same spelling
> (Unicode character sequence) as a keyword . . . Boolean
> literal . . . or the null literal . . .
> . . . . . . . .
> Letters and digits may be drawn from the entire Unicode
> character set . . .
> . . . . . . . .
> A Java letter is a character for which the method
> Character.isJavaLetter . . . returns true. A Java
> letter-or-digit is a character for which the method
> Character.isJavaLetterOrDigit . . . returns true.
> . . . . . . . .
> The Java letters include . . . for historical reasons, the
> ASCII underscore (_) . . . and dollar sign ($) . . .
(Separate syntax tests will be written when particular parts
now touched will have been further improved.)
Reference:
https://javaalmanac.io/jdk/1.0/langspec.pdf [§3.8]
* Take on the maintenance of Java filetype and syntax files
4052474a1b
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(i3config/swayconfig): update syntax scripts
modifications with the goals of:
- simplifying structure by using group `cluster`s
- improving visual highlighting responsiveness by using `nextgroup`
- improving recursive wm-msg command highlighting
- separating command variants meant for runtime and for config only
closes: vim/vim#14544dd83b63eb5
runtime(vim): Update base-syntax, fix nested function folding (vim/vim#14397)
Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.
Fixesvim/vim#143934ba70cab37
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, add legacy header folding
Allow for syntax-based folding of Vim9 script legacy header regions.
This is enabled with the "H" flag of the g:vimsyn_folding config variable.
closes: vim/vim#14530ce06493aeb
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
runtime(i3config): Line continuation is not detected for 'set' command (vim/vim#14531)
Problem: Valid i3config syntax is highlighted as error.
Solution: Skip over line-breaks correctly.
5392970921
Co-authored-by: julio-b <julio.bacel@gmail.com>
runtime(go): fix highlighting import string followed by some comment (vim/vim#14538)
122d068585
Co-authored-by: Linda_pp <rhysd@users.noreply.github.com>
runtime(vim): Improve Vim9 and legacy-script comment highlighting (vim/vim#13104)
This is a first-pass attempt to limit matching of Vim9 and legacy-script
comments to the appropriate syntactic contexts.
Vim9-script comments are highlighted at top level in a Vim9-script file,
in all :def functions, and in all :autocmd and :commmand command blocks.
Legacy-script comments are highlighted at top level in a legacy script
file, in all :func functions and in the Vim9-script preamble before the
:vim9script marker command.
Fixesvim/vim#13047, vim/vim#11307 and vim/vim#9587.
04e5363b82
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, no curly-brace names in Vim9 script (vim/vim#14466)
Remove curly-brace name matching for :def functions. This is not
supported in Vim9 script.
e43ace558a
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(java): Improve the matching of contextual keywords
- Recognise a _record_ contextual keyword.
- Recognise _non-sealed_, _sealed_, and _permits_ contextual
keywords.
- Admit _$_ to keyword characters.
- Group _abstract_, _final_, _default_, _(non-)sealed_
(apart from _(non-)sealed_, the incompossibility of these
modifiers calls for attention).
- Remove another _synchronized_ keyword redefinition.
I have also replaced a function with an expression. Before
patch 8.1.0515, it should have been declared :function! to
work with repeatable script sourcing; there is less to worry
about with an expression.
References:
https://openjdk.org/jeps/395 (Records)
https://openjdk.org/jeps/409 (Sealed Classes)
https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8closes: vim/vim#144035ccdcc482e
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
runtime(yaml): improve syntax highlighting for YAML
- Recognize block scalar style to avoid unexpected highlighting by `yamlFlowString` (fixvim/vim#11517)
- Improve performance of `yamlFlowMappingKey` by allowing execution by the NFA engine (fixvim/vim#10730)
- It was intentionally disabled before patterns were optimized by `s:SimplifyToAssumeAllPrintable`.
- Fix detection of flow style mapping indicators (fixvim/vim#8234).
- Enable highlighting of explicit mapping value indicators and node properties in flow style.
- Add syntax highlighting tests
closes: vim/vim#14354cc7597c1ed
Co-authored-by: itchyny <itchyny@cybozu.co.jp>
runtime(haskell): allow TODO keywords in comments
closes: vim/vim#14319b2e1fee72c
Co-authored-by: Enrico Maria De Angelis <enricomaria.dean6elis@gmail.com>
runtime(java): Recognise the inline kind of the {@return} tag (vim/vim#14284)
Also:
- Refine comment matching (javaComment{Error\ and,Start}).
- Continue rewriting regexps (prefer atom grouping with
non-capturing parens; factor out common prefixes in
alternations).
- Allow for relative paths with the _file_ attribute of
{@snippet}.
- Anticipate HTML in the @see tags.
- Match the nullary method parens in javaDocSeeTagParam.
- Improve the boundary patterns for summary sentences of
documentation.
> This sentence ends at ... or at the first tag (as defined
> below).
There are Java documentation tags (@) and there are HTML
tags (<?>) (with Markdown looming large; see JEP 467). With
block tags, e.g. @param, @return, @see, we begin another
documentation "sentence" whether or not the author has
terminated the summary sentence with a period; with
.<!-- -->, we may follow abbreviations, enumerations,
initials, (but instead consider @literal or ) _within_
the summary sentence. On the other hand, inline tags, e.g.
@code, @link, @literal, should not terminate the summary
sentence.
References:
https://bugs.openjdk.org/browse/JDK-8075778https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#firstsentencehttps://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html8e59a7ba88
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(java): Recognise the {@snippet} documentation tag (vim/vim#14271)
Remember that ‘code fragments are typically Java source
code, but they may also be fragments of properties files,
source code in other languages, or plain text.’ Therefore,
with these changes, markup tags are highlighted in the Java
source files (as external snippets) and in the {@snippet}
tags.
Also:
- Improve matching of the multi-line {@code} documentation
tag with any contained balanced braces.
- Recognise the {@literal} documentation tag.
- Highlight stray blanks in comments.
Related to an enhancement proposal for PCRE-like callouts
discussed at https://github.com/vim/vim/issues/11217.
References:
https://openjdk.org/jeps/413https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html3e72bf10a0
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(vim): Update base-syntax, remove old unused syntax groups. (vim/vim#14146)
Remove old unused syntax groups.
- vimRegion, vimPattern and vimKeyword removed in Vim 5.3.
- vimAuSyntax, vimAutoCmdOpt, vimAutoSet and vimStatement removed in 5.6.
The following were linked in :hi commands but never defined with :syn
and, most likely, never used:
- vimHLMod introduced in 5.0.
- vimKeycode and vimKeycodeError introduced in 5.4.
- vimElseif introduced in 5.6.
- vimFold introduced in 6.4.
- vimOperStar (and vimoperStar) introduced in 9.0.
76d62985c1
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve function definition highlighting (vim/vim#14203)
Improve function definition highlighting.
- Match bang and function modifiers - abort etc.
- Only match valid scope modifiers.
- Match listing commands.
- Don't match ex commands in function names.
- Split function syntax groups into :func and :def subgroups.
- Match Vim9-script parameter and return types.
- Limit legacy-script and Vim9-script comments to :func and :def
definitions, respectively.
35e6f4ca27
Omit the vimFunctionError change as it's a whitespace-only change and
will likely be superseded by later patches.
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, disallow '.' at start of menu item names (vim/vim#14232)
Disallow '.' at the start of a menu item name.
This is the menu path separator character and should be escaped with a
'\' in this case.
Partially fixesvim/vim#14230. "popup" is still incorrectly matched as the Ex
command.
ec21bafc13
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :highlight command (vim/vim#14228)
Improve :highlight command highlighting
- Use the same highlight groups for "default link" with and without
bang.
- Match some common line-continuation use.
- Match :hi clear variants.
- Highlight color-name values.
Resync vim.vim and generator/vim.vim.base.
9530fe4f3a
Co-authored-by: dkearns <dougkearns@gmail.com>
Problem: "NOTE"s, inline Vim script code, and links ending in digits may not be
highlighted correctly within the :Tutor.
Solution: set an explicit value for ":syntax iskeyword" that includes digits. Do
it after ":syntax include"s, so the included syntax/sh.vim doesn't mess with the
value.
Increase screen test width so all text within the conclusion section is visible.
Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
runtime(go): `goPackageComment` highlighting too broad
Previously this would highlight any comment before a line starting
`package`, for example
var (
// This comment would be highlighted as a goPackageComment
packages []string
)
The package clause is only valid when followed by a space[1], so include
this restriction
This is upstreaming a change from `go-vim`[2]
[1] https://go.dev/ref/spec#Package_clause
[2] d1c36cc4173d46de703c
Co-authored-by: Matthew Hughes <matthewhughes934@gmail.com>
runtime(vim): Update base-syntax, revert last change to vimUserFunc (vim/vim#14202)
Fix highlighting of ":echo (expr)" (broken in commit 61887b3) by
re-enabling the original fix for vim/vim#9987.
Addresses https://github.com/vim/vim/pull/14199#issuecomment-1999732062.
This will be fixed more generally when there is context-sensitive
matching for commands and functions.
b4b3d7de24
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :echo and :execute highlighting (vim/vim#14199)
Improve :echo and :execute highlighting.
- Add better line-continuation support for both commands.
- Improve the :execute command's expression argument matching.
- Remove the fix for issue vim/vim#9987 as this is now handled by correctly
matching the parens in :echo (...) as operator parens.
61887b3d6f
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve number matching (vim/vim#14175)
- Limit blob literals to an even number of hexadecimal digits and
correctly located dots.
- Match octal numbers.
The current version unsuccessfully attempts to match a leading '-' as
part of the float literal. It's actually parsed as part of the literal
for all numbers but the syntax file hasn't matched it like that for a
long time and highlights negative numbers as UNARY-MINUS NUMBER. This
will be fixed when better expression matching is implemented.
5cd86c6cff
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (vim/vim#14162)
Improve :menu and :menutranslate highlighting.
- Match args to :menutranslation and :popup.
- Only highlight special notation in {rhs} of :menu, like :map.
- Allow line continuations in {rhs} of :menu and between {english} and
{mylang} of :menutranslation, matching common usage.
- Bug fixes.
62b26040eb
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(java): Recognise string templates (vim/vim#14150)
As this is encouraged in the referenced JEPs, "to visually
distinguish a string template from a string literal, and
a text block template from a text block", the default
colours for java\%[Debug]StrTempl are made distinct from
java\%[Debug]String.
According to §3.2 Lexical Translations (JLS, c. 1996 or any
more recent version), line terminators, white space, and
comments are discarded before tokens are accepted. Since
a template expression comprises a template processor, a dot,
and a template, it may be visually appealing to break up
its head across a few lines whenever its tail already spans
multiple lines. Curiously, no allowance for it is made in
the distributed tests for OpenJDK 21; the proposed regexp
patterns take in consideration a line terminator and white
space after a dot.
References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465a2c65809da
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(c): Recognize "__inline" (vim/vim#14145)
`__inline` is recognized by GCC, and may even be preferred, as MSVC does
not recognize `__inline__`.
63c39e4ef7
Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
runtime(vim): Update base-syntax, fix escaping :syn and :hi sub-groups (vim/vim#14137)
* 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.
e5c9ba6015
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(sh): Update syntax file, fix issue vim/vim#962 (vim/vim#14138)
Allow the opening parenthesis of a multiline array assignment, within an
if statement, to appear at EOL.
Fixes issue vim/vim#962.
1bdc9435c1
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, fix issue vim/vim#14135 (vim/vim#14136)
Fix incorrect error highlighting for function calls in :command
definitions. vimFunctionError should be restricted to :function header
lines.
fixes: vim/vim#14135691aee8b07
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update base-syntax, improve :augroup highlighting (vim/vim#14125)
- 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).
c4aef9a97b
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(java): Recognise text blocks (vim/vim#14128)
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/378https://docs.oracle.com/javase/specs/jls/se17/html/jls-3.html#jls-3.10.7Closesvim/vim#10910.
b3030b653b
Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
runtime(java): Recognise _when_ clauses in _switch_ blocks
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: vim/vim#141059ecf02cd5f
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
runtime(spec): Recognize SourceLicense tag name in RPM spec syntax (#14046)
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.
315cd1fbcb
Co-authored-by: Petr Pisar <ppisar@redhat.com>
Help outlines, invoked by `gO`, displays the help section titles in the
location list window. This feature is implemented by setting the buffer
lines after opening the window, but this implementation breaks the
assumption that the quickfix window texts are consistently constructed
by the quickfix list items. I think we can use the conceal feature here.
Using conceal here improves interoperability between quickfix plugins,
and also simplifies the outline implementation.
Originally reported at https://github.com/itchyny/vim-qfedit/issues/12
runtime(vim): Update base-syntax, remove unused vimString region
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: vim/vim#140351633de8c35
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
runtime(vim): update Vim Syntax generator
- 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: vim/vim#140315c3855bcab
Co-authored-by: h-east <h.east.727@gmail.com>
runtime(vim): include Vim Syntax generator
fixes: vim/vim#13939closes: vim/vim#14021
related: vim-jp/syntax-vim-ex#289b53c052d5
Omit the generator as it cannot be used for Nvim.
Keep vimHLGroup and vimOnlyHLGroup separate.
N/A patch:
vim-patch:b418a51933bb
Co-authored-by: h-east <h.east.727@gmail.com>
runtime(vim): accept dot in completionList for Vim9 syntax (vim/vim#13832)
if you have autoloaded command complete function in vim9script, it shouldn't be highlighted as Error:
```
import autoload "share.vim"
command! -range=% -nargs=? -complete=custom,share.Complete Share share.Paste(<q-args>, <line1>, <line2>)
```
`share.Complete` is a valid complete function.
ceed36873e
Co-authored-by: Maxim Kim <habamax@gmail.com>
runtime(vim): Update syntax file (vim/vim#14009)
- 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
b614b284ee
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(gpg): Mark dangerous use-embedded-filename with WarningMsg
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/T4500https://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: vim/vim#139616d91227267
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
runtime(dosbatch): improve '::' comment highlighting
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 vim/vim#13666, while allowing control of highlighting them in
command blocks requested in vim/vim#11778 and first attempted in vim/vim#11980.
related: vim/vim#11980fixes: vim/vim#13666f7f33e3719
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Mike Williams <mikew@globalgraphics.com>
runtime(vim): Update syntax file (vim/vim#13969)
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.
7c5aeaffa2
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Improve keymap file highlighting (vim/vim#13550)
- Match :loadkeymap to EOF as a region and contain only allowed items.
- Add highlighting for <Char- notation.
- add basic syntax highlighting tests
69866449dd
N/A patches:
vim-patch:35928ee8f80ea721e92bb856c8ecde2cced46bb9
vim-patch:b5352931b354eb67eb7d223cc09c98dcf1b547b6
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update syntax and ftplugin files (vim/vim#13924)
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.
21ce159e05
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(ant): Update syntax file (vim/vim#13926)
Remove invalid display option from syn-keyword commands.
Take over maintenance of this file.
0cc6108fea
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(mail): fixvim/vim#13913 (vim/vim#13917)
switch to the DFA engine for the emoji collaction range
046a0f75d0
Co-authored-by: gi1242 <gi1242+github@gmail.com>
Co-authored-by: GI <gi1242+vim@gmail.com>
runtime(vim): Update syntax file (vim/vim#13906)
Highlight :2match and :3match and add these to :help ex-cmd-index.
9c5b90db03
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(sh): Add handling for ksh93 shared-state comsubs and mksh valsubs (vim/vim#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: vim/vim#9514add31baeda
Co-authored-by: Johnothan King <johnothanking@protonmail.com>
runtime(chuck): include ChucK syntax file (vim/vim#13895)
3b2c27415d
Co-authored-by: Andrea C from The App <3269984+gacallea@users.noreply.github.com>
Co-authored-by: gacallea <gacallea@users.noreply.github.com>
runtime(go): update Go syntax file (vim/vim#13896)
Update the Go syntax file with some recent changes made to vim-go.
ea9a93e5b0
Co-authored-by: Billie Cleek <bhcleek@users.noreply.github.com>
runtime(i3config): remove always from `focus_follows_mouse`
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.
a39af02904
Co-authored-by: James Eapen <james.eapen@vai.org>
runtime(odin): include ftplugin, syntax and indent script (vim/vim#13867)
211211052d
Translate the files from Vim9 script to legacy Vim script. Notably:
- Prefer case-matching comparisons where needed.
- Save and restore `&cpo`.
- Make the functions script-local. (Pretty easy to use these in expr options now
since Vim 9.0 anyways)
Add a note after the header for each file stating that they're manually
translated.
Co-authored-by: Maxim Kim <habamax@gmail.com>
Problem: Modula2 filetype support lacking
Solution: Improve the Modula-2 runtime support, add additional modula2
dialects, add compiler plugin, update syntax highlighting,
include syntax tests, update Makefiles (Doug Kearns)
closes: vim/vim#6796closes: vim/vim#811568a8947069
- Luaify the detection script:
- Split the `(*!m2foo*)` and `(*!m2foo+bar*)` detection into two Lua patterns,
as Lua capture groups cannot be used with `?` and friends (as they only work
on character classes).
- Use `vim.api.nvim_buf_call()` (ew) to call `modula2#SetDialect()` to ensure
`b:modula2` is set for the given bufnr.
- Skip the syntax screendump tests. (A shame as they test some of the detection
from `(*!m2foo+bar*)` tags, but I tested this locally and it seems to work)
- Port the synmenu.vim changes from Vim9 script. (Also tested this locally)
- (And also add the missing comma for `b:browsefilter` from earlier.)
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
runtime(fortran): update fortran syntax (vim/vim#13870)
Support most remaining features of Fortran 2018/2023
Small improvements to folding etc,
Code cleanup: use \? instead of mix of \= and \?
ef79c57837
Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
Problem: default diff highlighting is too noisy
Solution: Link diff highlighting groups to new
Added/Removed/Changed, revert previous change
(Romain Lafourcade)
Remove diff* links added in vim/vim#13776 and doc added in commit b1392be
The links added in vim/vim#13776 are way too noisy for the contexts in which
the `diff` syntax is applied (git commits, patches, etc.).
This commit:
- removes those links
- adds new default highlighting groups Added, Changed and
Removed
- links the diff highlighting groups to those new defaults
- removes the doc changes
- adjusts the syntax_completion test for those newly added group
names
Note: Changes to the default color schemes will be handled separately,
by adding links to those newly created Added/Removed/Changed
highlighting groups.
related: vim/vim#13776closesvim/vim#13825124371c5a1
Co-authored-by: Romain Lafourcade <romain.lafourcade@razorfish.fr>
runtime(vim): Add support for <ScriptCmd> syntax (vim/vim#10686)
Adding `<ScriptCmd>` to list of angle-bracket notation syntax, just like `<Cmd>`
`<Cmd>` is already highlighted.
```vim
nnoremap <leader>o <Cmd>Oldfiles()<CR>
```
`<ScriptCmd>` is not.
80beeef0c6
Co-authored-by: dezza <402927+dezza@users.noreply.github.com>
runtime(sh): Update sh syntax and add local keyword for bash (vim/vim#13806)
add `local` in shStatement
b16fc98055
Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
runtime(mermaid): Syntax fix (vim/vim#13774)
* runtime(mermaid): Fix arrow syntax
* runtime(mermaid): Disable syntax for identifier to avoid false match
* runtime(mermaid): Add some C++ type syntax highlight
* runtime(mermaid): Update last change time in header
a03647acc3
Co-authored-by: KSR-Yasuda <31273423+KSR-Yasuda@users.noreply.github.com>
runtime(diff): Update default links (vim/vim#13776)
Problem: Current default links for `diffAdded`, `diffChanged`, and
`diffRemoved` do not address the diff nature of the filetype.
Solution: Use `DiffAdd`, `DiffChange`, and `DiffDelete`.
closes: vim/vim#1375900b470052b
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
runtime(r): Update R runtime files and docs (vim/vim#13757)
* Update R runtime files
- Fix indentation issue with ggplot().
- Setlocal autoindent in indent/r.vim.
- New syntax option: rmd_include_latex.
- Clear syn iskeyword to recognize _ as keyword.
- Document some options.
- remove the test has("patch-7.4.1142")
- Update changed date of doc files
9042bd8b09
Co-authored-by: Jakson Alves de Aquino <jalvesaq@gmail.com>
Runtime(fortran): updates to indent, syntax and ftplugin (vim/vim#13752)
* runtime update fortran.vim
Add folding for newer features of Fortran
* Runtime Update fortran.vim
Add indent support for newer features of Fortran
* Runtime Update fortran.vim
Add newer features of Fortran to matchit patterns
ea9964a36f
Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
runtime(masm): add variants of opcodes (vim/vim#13734)
that can actually be generated by compilers
3746887997
Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
runtime(vim): Update syntax file (vim/vim#13739)
Match all ex commands after ":" and the "|" command separator.
Exceptions are not handled yet and :insert/:change/:append are still not
matched after the command separator bar.
21064ebcd6
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(fortan): update fortran syntax rules and doc notes
Update to the Fortran 2023 standard. Reorganize some code to reflect the
dropping of dialect support in the previous commit. Minor improvements.
closes: vim/vim#1371271cbe8e17a
Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
runtime(logtalk): Update Logtalk runtime files for the latest language spec (vim/vim#13697)
0f61943eb7
Co-authored-by: Paulo Moura <pmoura@logtalk.org>
runtime(racket): update Racket runtime files (vim/vim#13693)
This brings the included Racket runtime files to commit 43bfc87 (update
headers, 2023-12-15) of https://github.com/benknoble/vim-racket. Note
that not all files from that repository are included. (In particular,
the ftdetect script is omitted for now.)
5eb9cb53d6
Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
runtime(vim): Update syntax file, fix missing for highlight (vim/vim#13668)
Fix highlighting of :for command. Link the vimFor syntax group to the
vimCommand highlight group.
Error introduced in commit f686921
1c97b5c0c0
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(vim): Update syntax file (vim/vim#13653)
Improve variable highlighting in :let, :unlet, :const and :for commands.
Match registers and local, global and terminal option variables.
f6869212c9
Co-authored-by: dkearns <dougkearns@gmail.com>
runtime(syntax): unlet b:filetype_in_cpp_family for cpp & squirrel
Update runtime/syntax/cpp.vim and runtime/syntax/squirrel.vim to unlet
b:filetype_in_cpp_family as it remains set even after updating the ft of
a file manually or through a modeline, not allowing c specific keywords
to be highlighted.
Since the variable b:filetype_in_cpp_family is only used by the c.vim
syntax script, unlet it directly after sourcing the c.vim runtime file
instead of at the end of the script.
Also update the last Change Header for both files.
closes: vim/vim#13650ff0baca865
Co-authored-by: laburnumT <laburnumtec@gmail.com>