Add the `--inhibited` flag for the bindsym/bindcode commands.
closes: #15891
Signed-off-by: CismonX <admin@cismon.net>
Signed-off-by: James Eapen <james.eapen@vai.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit makaes the following changes to the vim help syntax:
- fix excessive URL detection in help, because `file:{filename}` in
doc/options.txt is determined to be a URL.
- update highlighting N for :resize in help
- split Italian-specific syntax into separate help script
- highlight `Note` in parentheses in help
- update 'titlestring' behaviour in documentation for invalid '%' format
closes: #15883
Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: lf config files are not recognized
Solution: detect lfrc files as lf filetype, include a syntax
script for lf files (Andis Spriņķis).
References:
- https://github.com/gokcehan/lfcloses: #15859
Signed-off-by: Andis Spriņķis <spr.andis@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
And do not link either to any group.
Resolveszzzyxwvut/java-vim#2.
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: current command completion is a bit limited
Solution: Add the shellcmdline completion type and getmdcomplpat()
function (Ruslan Russkikh).
closes: #15823
Signed-off-by: Ruslan Russkikh <dvrussk@yandex.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The syntax script allowed for single backslash escapes like this
"string\""
But did not accommodate for the uncommon case:
"<key>\\"
Let's fix this by also skipping over double backslashes in the
skillString region.
closes: #15832
Signed-off-by: Simão Afonso @ Powertools Tech <simao.afonso@powertools-tech.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Enable folding of class, enum and interface declarations.
- Highlight constructor names with the Function highlight group, like
other special methods.
- Mark function definitions using special method names as errors.
- Highlight :type arguments.
fixes: #14393#issuecomment-2042796198.
closes: #13810
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: cannot run single syntax tests
Solution: Support running a subset of syntax tests
(Aliaksei Budavei)
Two methods of assembling a subset of test filenames for
selection are provided:
* Filename and filetype Make targets will be generated, and
multiple such targets can be passed before the mandated
trailing "test" target, e.g. "make html markdown test".
* Filenames and their parts can be specified as a regular
expression that is assigned to a "VIM_SYNTAX_TEST_FILTER"
environment variable, and used with the test Make target,
e.g. "VIM_SYNTAX_TEST_FILTER=html\\\|markdown make test".
(This variable will be ignored and the whole suite will be
run when Make is GNU Make and a parent Makefile is used.)
Methods can be used alone or together, with the Make targets
having the higher precedence. Neither method will influence
the order of test execution.
closes: #15670
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
With "g:markdown_fenced_languages" defined and "java" added
to its list, a circular dependency between the Markdown and
Java syntax files will be made. To break it, no Markdown
documentation comments will be recognised in fenced blocks
in Markdown files; in order to view Java source files,
"java" must be removed from "g:markdown_fenced_languages",
and this task can be automated as follows.
1) Add to "~/.after/ftplugin/java.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
\ !(exists("g:java_ignore_javadoc") ||
\ exists("g:java_ignore_markdown"))
let s:idx = index(g:markdown_fenced_languages, 'java')
if s:idx > -1
call remove(g:markdown_fenced_languages, s:idx)
endif
unlet s:idx
endif
------------------------------------------------------------
2) Optionally add to "~/.after/ftplugin/markdown.vim":
------------------------------------------------------------
if exists("g:markdown_fenced_languages") &&
\ index(g:markdown_fenced_languages, 'java') < 0
call add(g:markdown_fenced_languages, 'java')
endif
------------------------------------------------------------
(Make sure that the above snippets appear in the files under
the "ftplugin" NOT "syntax" directory.)
Finally, unless the new version of the syntax file is made
available from "$VIMRUNTIME" (and from "~/.vim/syntax" if
necessary), OTHER discoverable file versions will be used
whose behaviour may interfere with this fix.
related: #15740closes: #15796
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Complement "g:java_ignore_javadoc" with "g:java_ignore_html"
and "g:java_ignore_markdown" to allow selectively disabling
the recognition of HTML and CommonMark respectively.
(Note that this is not a preview feature.)
======================== LIMITATION ========================
According to the syntactical details of JEP 467:
> Any leading whitespace and the three initial / characters
> are removed from each line.
>
> The lines are shifted left, by removing leading whitespace
> characters, until the non-blank line with the least
> leading whitespace has no remaining leading whitespace.
>
> Additional leading whitespace and any trailing whitespace
> in each line is preserved, because it may be significant.
the following example:
------------------------------------------------------------
/// A summary sentence.
/// A list:
/// - Item A.
/// - Item B.
///
/// Some code span, starting here `
/// 1 + 2 ` and ending at the previous \`.
------------------------------------------------------------
should be interpreted as if it were written thus:
------------------------------------------------------------
///A summary sentence.
/// A list:
/// - Item A.
/// - Item B.
///
/// Some code span, starting here `
/// 1 + 2 ` and ending at the previous \`.
------------------------------------------------------------
Since automatic line rewriting will not be pursued, parts of
such comments having significant whitespace may be ‘wrongly’
highlighted. For convenience, a &fex function is defined to
‘correct’ it: g:javaformat#RemoveCommonMarkdownWhitespace()
(:help ft-java-plugin).
References:
https://openjdk.org/jeps/467https://spec.commonmark.org/0.31.2closes: #15740
Co-authored-by: Tim Pope <code@tpope.net>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Some gnu indent options take negative numbers (e.g. --indent-label).
Add matching for an optional single '-' before the number.
closes: #15754
Signed-off-by: John M Devin <john.m.devin@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Multiple timestamps in the same line were not highlighted
Solution: Adapt the syntax to support multiple timestamps
fixes: #15703closes: #15707
Signed-off-by: ObserverOfTime <chronobserver@disroot.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Define "g:java_syntax_previews" and include number 476 in
its list to enable this recognition:
------------------------------------------------------------
let g:java_syntax_previews = [476]
------------------------------------------------------------
Reference:
https://openjdk.org/jeps/476closes: #15709
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Allow function command modifiers.
- Match function bodies starting with empty lines.
Command modifiers reported by @Konfekt.
fixes#15671closes: #15674
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Define "g:java_syntax_previews" and include number 455 in
its list to enable this recognition:
------------------------------------------------------------
let g:java_syntax_previews = [455]
------------------------------------------------------------
Reference:
https://openjdk.org/jeps/455closes: #15698
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: salt files are not recognized
Solution: Detect '*.sls' files as filetype salt,
include a syntax script (Gregory Anders)
closes: #15689
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: jinja files are not recognized
Solution: detect '*.jinja' files a jinja filetype,
include jinja syntax script (Gregory Anders)
related: #15689
Signed-off-by: Gregory Anders <greg@gpanders.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Stop assigning by default the NonText highlighting group for
javaConceptKind modifiers since its colour is hardly
distinguishable from a background colour for a range of
colour schemes.
fixes#15237
related #15238closes: #15664
Co-authored-by: Dexter Gaon-Shatford <dexter@gaonshatford.ca>
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match Vim9 boolean and null literals in expression arguments of :if,
:elseif, :while and :return.
closes: #15684
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
By default spell checking is enabled for all text, but adding
`contains=@Spell` to syntax rules restricts spell checking to those
syntax rules. See `:help spell-syntax` for full details.
Variable names and headers are far more likely than comments to contain
spelling errors, so only enable spell checking in comments.
Introduced in https://github.com/xuhdev/syntax-dosini.vim/pull/8
cc @tobinjt
closes: #15655
Signed-off-by: John Tobin <johntobin@johntobin.ie>
Signed-off-by: Hong Xu <hong@topbug.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Match -addr and -keepscript attributes and generate -addr values.
- Match attribute errors where = is specified.
- Highlight attributes with Special like other Ex command options.
- Don't highlight user-specified completion function args.
- Match :delcommand -buffer attribute.
closes: #15586
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Recognize colon-delimited second part of Runas_Spec that specifies
permitted groups, e.g.:
alan ALL = (root, bin : operator, system) ALL
This implementation is sloppy because it accepts any amount of colons
delimiting further Runas_Lists, but for now that's better than bailing
out completely as soon as a colon is encountered (esp. given that the
default sudoers uses these colons, breaking highlighting OOTB).
Also, while at it, make Vim recognize all Tag_Spec items, not just
{,NO}PASSWD
closes: #15607
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match '(,'),'[,'],'{, and '} marks in Ex command ranges.
Thanks to Maxim Kim.
Fixes#15332.
Closes#15337.
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Improving syntax highlighting by allowing numbers, - and a $ as suffix
in user constants and by allowing hwConstants in If-Then statements
closes: #15059
Signed-off-by: Tom Crecelius <holly@net-eclipse.net>
Signed-off-by: Ola Söder <rolfkopman@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Introduce a new API variable "g:java_syntax_previews" whose
value must be a list of syntax preview feature numbers.
Enumerate the currently supported numbers in a table at the
end of the documentation entry for "ft-java-syntax".
Also, disable the recognition of String Templates. Despite
the withdrawal of this preview feature in its proposed form
from the upcoming JDK 23 release and the fact that the JDK
22 release is coming to EOL this September, an earlier
iteration of this preview feature was included in JDK 21
(LTS) whose EOL is projected to fall due in late 2028 and,
therefore, retain the current implementation.
Define "g:java_syntax_previews" and include number 430 in
its list to enable the recognition of String Templates:
------------------------------------------------------------
let g:java_syntax_previews = [430]
------------------------------------------------------------
References:
https://openjdk.org/jeps/430 (Preview)
https://openjdk.org/jeps/459 (Second Preview)
https://openjdk.org/jeps/465 (Third Preview)
https://mail.openjdk.org/pipermail/amber-spec-experts/2024-April/004106.htmlcloses: #15579
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Match :loadkeymap after Ex colons and bars.
Don't generate :loadkeymap as it is matched with a custom syntax group.
closes: #15554
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The end marker is not required to match the indent of :let when "trim"
is specified, it may also appear without leading whitespace as normal.
closes: #15564
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
* Improve heredoc handling
- Support "trim" for all the embedded scripts.
- Check the indent of "trim" for "let" and all the embedded scripts.
* Update missing part of vim.vim.base in the commit
d164f2a521.
* Update gen_syntax_vim.vim to catch up with 9.1.0685's source code.
closes: #15542
Signed-off-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
- Obtain and pass through translated messages with this
function.
- If "g:java_foldtext_show_first_or_second_line" is defined,
assign this function to &foldtext.
closes: #15549
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Analyzing failed screendumps is hard
Solution: Facilitate the viewing of rendered screendumps under src/
add some documentation on how to use the viewdumps.vim
script (Aliaksei Budavei)
With the submitted "viewdumps.vim" script, a few manual
steps in typical workflows (see below) can be automated.
The updated "README.txt" contains additional information.
============================================================
Reviewing LOCAL failed screendump tests can be arranged as
follows:
1) Run tests and generate screendumps:
------------------------------------------------------------
cd /path/to/fork/src/testdir
make
------------------------------------------------------------
2) Examine the screendumps from the "failed" directory:
------------------------------------------------------------
../vim -u NONE -S viewdumps.vim
------------------------------------------------------------
============================================================
Reviewing UPLOADED failed screendump tests can be arranged
as follows (it can be further locally scripted):
1) Fetch an artifact with failed screendumps from
"github.com/vim/vim/actions/runs/A_ID/artifacts/B_ID".
2) Extract the archived files:
------------------------------------------------------------
unzip /tmp/failed-tests.zip -d /tmp
------------------------------------------------------------
3) Set up the "dumps" directory. Create a symlink to
"/path/to/fork/dirs/dumps" in the extracted directories so
that term_dumpdiff() can be used. (The lookup algorithm
resolves "dumps" for every loaded filename. So, with
"/tmp/src/testdir/failed/*.dump" files passed as script
arguments, the algorithm will make the files in
"/tmp/src/testdir/dumps" queried.)
------------------------------------------------------------
cd /path/to/fork
ln -s $(pwd)/src/testdir/dumps /tmp/src/testdir/dumps
------------------------------------------------------------
4) Examine the extracted screendumps:
------------------------------------------------------------
./src/vim -u NONE -S src/testdir/viewdumps.vim \
/tmp/src/testdir/failed/*.dump
------------------------------------------------------------
5) Clean up:
------------------------------------------------------------
unlink /tmp/src/testdir/dumps
rm -rf /tmp/src
------------------------------------------------------------
============================================================
Reviewing SUBMITTED FOR PULL REQUEST screendump tests can be
arranged as follows (it can be further locally scripted):
1) List the fetched changeset and write the changed "dumps"
filenames to "/tmp/filelist":
------------------------------------------------------------
cd /path/to/fork
git switch prs/1234
git diff-index --relative=src/testdir/dumps/ \
--name-only prs/1234~1 > /tmp/filelist
------------------------------------------------------------
2) Reconcile relative filepaths, and copy next-to-be-updated
"dumps" files in the "failed" directory (note the missing
new screendumps, if any):
------------------------------------------------------------
git switch master
cd src/testdir/dumps
test -d ../failed || mkdir ../failed
cp -t ../failed $(cat /tmp/filelist)
------------------------------------------------------------
3) Remember about the introduced INVERTED relation between
"dumps" and "failed", i.e. the files to be committed are in
"dumps" already and their previous versions are in "failed";
therefore, copy the missing new screendumps from "dumps" to
"failed" (otherwise these won't be shown):
------------------------------------------------------------
git switch prs/1234
cp -t ../failed foo_10.dump foo_11.dump foo_12.dump
------------------------------------------------------------
4) Examine the screendumps from the "failed" directory (new
screendumps will be shown with no difference between their
versions):
------------------------------------------------------------
cd ..
../vim -u NONE -S viewdumps.vim
------------------------------------------------------------
closes: #15515
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
The end marker must appear on line of its own without any trailing
whitespace.
Whitespace is incorrectly allowed before all end markers. Limiting this
only to heredocs where "trim" was specified, and with the correct
indent, is currently an intractable problem given that contained syntax
groups (in this case :let) cannot be limited to start patterns.
Highlight interpolated expressions when "eval" is specified.
cloess: #15511
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Inside batch files, for-variables must be written as %%i, not %i.
closes: #15453
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Closing parentheses were often highlighted as errors.
Add a syntax sync command to reduce the error.
Also fix that `defined` was not highlighted as an operator inside
parentheses. E.g.:
```
if defined foo (
if defined bar (
...
)
)
```
The first `defined` was highlighted but the second one was not.
related: #15453
Signed-off-by: Ken Takata <kentkt@csc.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
It addresses the following issues:
- Fix highlight of let and var javascript keywords
According to runtime/doc/syntax.txt, Identifier is for variable names.
let/var are not variable names, they are keywords
- Add highlighting for "from" keyword in javascript
- Fix highlight of function keyword in javascript
According to docs, Function is for function names, so the function
keyword should just be Keyword.
- Fix highlight of static keyword in javascript
According to vim docs: StorageClass static, register, volatile, etc.
closes: #15480
Signed-off-by: Tobiasz Laskowski <tobil4sk@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
With the submitted "viewdumps.vim" script, a few manual
steps in typical workflows (see below) can be automated.
The updated "README.txt" contains additional information.
============================================================
Reviewing LOCAL failed syntax tests can be arranged as
follows:
1) Run tests and generate screendumps:
------------------------------------------------------------
cd /path/to/fork/runtime/syntax
make clean test
------------------------------------------------------------
2) Examine the screendumps from the "failed" directory:
------------------------------------------------------------
../../src/vim --clean -S testdir/viewdumps.vim
------------------------------------------------------------
============================================================
Reviewing UPLOADED failed syntax tests can be arranged as
follows (it can be further locally scripted):
1) Fetch an artifact with failed screendumps from
"github.com/vim/vim/actions/runs/A_ID/artifacts/B_ID".
2) Extract the archived files:
------------------------------------------------------------
unzip /tmp/failed-tests.zip -d /tmp
------------------------------------------------------------
3) Set up the "dumps" directory. Create a symlink to
"/path/to/fork/dirs/dumps" in the extracted directories so
that term_dumpdiff() can be used. (The lookup algorithm
resolves "dumps" for every loaded filename. So, with
"/tmp/runtime/syntax/testdir/failed/*.dump" files passed
as script arguments, the algorithm will make the files in
"/tmp/runtime/syntax/testdir/dumps" queried.)
------------------------------------------------------------
cd /path/to/fork
ln -s $(pwd)/runtime/syntax/testdir/dumps \
/tmp/runtime/syntax/testdir/dumps
------------------------------------------------------------
4) Examine the extracted screendumps:
------------------------------------------------------------
./src/vim --clean -S runtime/syntax/testdir/viewdumps.vim \
/tmp/runtime/syntax/testdir/failed/*.dump
------------------------------------------------------------
5) Clean up:
------------------------------------------------------------
unlink /tmp/runtime/syntax/testdir/dumps
rm -rf /tmp/runtime
------------------------------------------------------------
============================================================
Reviewing SUBMITTED FOR PULL REQUEST syntax tests can be
arranged as follows (it can be further locally scripted):
1) List the fetched changeset and write the changed "dumps"
filenames to "/tmp/filelist":
------------------------------------------------------------
cd /path/to/fork
git switch prs/1234
git diff-index --relative=runtime/syntax/testdir/dumps/ \
--name-only prs/1234~1 > /tmp/filelist
------------------------------------------------------------
2) Reconcile relative filepaths, and copy next-to-be-updated
"dumps" files in the "failed" directory (note the missing
new screendumps, if any):
------------------------------------------------------------
git switch master
cd runtime/syntax/testdir/dumps
cp -t ../failed $(cat /tmp/filelist)
------------------------------------------------------------
3) Remember about the introduced INVERTED relation between
"dumps" and "failed", i.e. the files to be committed are in
"dumps" already and their previous versions are in "failed";
therefore, copy the missing new screendumps from "dumps" to
"failed" (otherwise these won't be shown):
------------------------------------------------------------
git switch prs/1234
cp -t ../failed foo_10.dump foo_11.dump foo_12.dump
------------------------------------------------------------
4) Examine the screendumps from the "failed" directory (new
screendumps will be shown with no difference between their
versions):
------------------------------------------------------------
cd ..
../../../src/vim --clean -S viewdumps.vim
------------------------------------------------------------
closes: #15476
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>