| Age | Commit message (Collapse) | Author | Files |
|
Code like ${!#} flags the "#" as shDerefWordError [1]; the "!prefix"
syntax region delegates to one of the shDerefSpecial handlers via
@shDerefList, but it misses the "#" case as valid for ${##} and ${!#}.
[1]: https://vi.stackexchange.com/q/48617/10604
Correct that. Indirection is only valid in Bash in Ksh, so rearrange the
"!" handling to be conditional.
closes: vim/vim#20016
Helped-by: Christian Brabandt <cb@256bit.org>
https://github.com/vim/vim/commit/10040bc9cde340c52b5093cacb1d60fd2e621883
Co-authored-by: D. Ben Knoble <ben.knoble+github@gmail.com>
|
|
(#38719)
Request less backtracking to function-name candidates for
nonlinear patterns with any regexp engine BUT force using
the old engine with these patterns to avoid incurring an
additional penalty, according to ":syntime report", when the
new regexp engine is preferred.
fixes: vim/vim#19847
closes: vim/vim#19849
https://github.com/vim/vim/commit/12f6f20552187432ac67e3bd83a285a1e608b457
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
|
|
- Highlight keywords "function" and "namespace" with
the "Keyword" group ("shFunctionKey").
- Highlight function body delimiters "{" and "}" with the
"Delimiter" group ("shFunctionExprRegion").
- Highlight function body delimiters "(" and ")" with the
"Operator" group ("shFunctionSubShRegion").
- Also, follow one style in folding all supported variants
of function bodies for grouping commands too by enclosing
a delimited function body, e.g. "{" and "}", in a fold and
leaving its function header, e.g. "function f()", out of
it when the header is written on a separate line.
To restore previous colouring, add to "after/syntax/sh.vim":
------------------------------------------------------------
hi link shFunctionKey Function
hi link shFunctionExprRegion Function
hi link shFunctionSubShRegion Function
------------------------------------------------------------
fixes: https://github.com/vim/vim/pull/19638#issuecomment-4052635546
closes: vim/vim#19638
https://github.com/vim/vim/commit/955c02dff76e097fc40344a4fbb0af9b9796208d
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
|
|
- Drop the remaining undefined "shFunctionStart" references
(gone in v7.2b.000, c236c16d0).
- Revise nestable contexts where function definitions are
supported:
* Stop looking for function definitions in arithmetic
expressions.
* Recognise function definitions enclosing other function
definitions.
- In addition to grouping commands "{}" and "()", also match
other compound commands (e.g. "if"; see "shFunctionCmd*")
whenever these commands are supported as complete function
bodies.
- Balance body delimiters "(" and ")" for "shFunctionFour"
in Bash; match such function bodies whenever the use of
the function parameter list "()" token is optional, i.e.
when the "function" reserved word is present.
- Enable the use of "shFunctionFour" definitions.
- Do not claim optional leading whitespace characters before
a matched function definition.
- Prefer patterns with ASCII atoms (e.g. "\h") to equivalent
collections (e.g. "[A-Za-z_]") for speed.
- Accommodate word-boundary assertions in function name
patterns to names that may start and/or end with supported
non-word characters, e.g. "@test:".
- Match more valid function names in Bash: non-ASCII names,
non-word names.
- Allow for function names with "do", "done", etc. prefixes;
confine these name checks to "shDoError" and "shIfError".
fixes: vim/vim#19619
related: vim/vim#19638
References:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_09_04
https://gitweb.git.savannah.gnu.org/gitweb/?p=bash.git;a=blob_plain;f=doc/bash.html;hb=637f5c8696a6adc9b4519f1cd74aa78492266b7f
https://web.archive.org/web/20151105130220/http://www.research.att.com/sw/download/man/man1/ksh88.html
https://web.archive.org/web/20151025145158/http://www2.research.att.com/sw/download/man/man1/ksh.html
http://www.mirbsd.org/htman/i386/man1/mksh.htm
https://github.com/vim/vim/commit/9c0d057e3d5a456b2f2879860e5e57bcdf130017
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Co-authored-by: Johnothan King <johnothanking@protonmail.com>
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
|
|
Remove `nextgroup=shComment` from the `shEscape` syntax pattern.
This was causing `#` characters after escape sequences inside
double-quoted strings to be misinterpreted as comments, breaking
highlighting for the rest of the file.
Add a test case for escaped characters followed by # in double quotes.
fixes: vim/vim#19053
closes: vim/vim#19414
https://github.com/vim/vim/commit/c68e64dac3eaa48d65bb333c66b3d34707dd6acc
Co-authored-by: Bozhidar Batsov <bozhidar@batsov.dev>
|
|
script
- Amend syntax highlighting to allow for ksh93 discipline function names
(e.g. 'foo.get()') and mksh's odd function naming idiosyncrasies
(shNamespaceOne was introduced to enforce stricter naming rules for
ksh93 namespaces).
- Remove 'bind' from ksh93 syntax (such a builtin has never been
implemented in ksh93).
- 'xgrep' is only available in ksh93v- as an alternative way to
invoke the builtin 'grep -X', so reflect that in the syntax
highlighting.
- Forbid bash-style 'function name() {' syntax when highlighting
ksh88 and ksh93 scripts.
- Fix bug causing ' ()' to be incorrectly validated in mksh scripts.
- Add the many ksh93/ksh2020 .sh.* variables to the list of special
variables.
- Amend iskeyword to allow '.' so that '.sh.tilde.get' and such are
valid function names/variable names. (For mksh functions starting
with odd characters like '%' and '@' this would probably have too
many bad side effects, so I've omitted such a change for that shell.)
- Add new syntax tests and regenerate syntax dump files
closes: vim/vim#19383
https://github.com/vim/vim/commit/56033b9df3ef56d8e37b7927521baf621fd88ab7
Co-authored-by: Johnothan King <johnothanking@protonmail.com>
|
|
containing digits
fixes: vim/vim#19082
https://github.com/vim/vim/commit/16c22790627f063981ce75ef3d4da1eb4f6bf8d0
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
- unified bashStatement, kshStatement and shStatement as much as
possible
- separated builtin commands from external programs
- cleaned up kornshell flavor logic
- fixed alias syntax highlighting
- added test for bash alias syntax highlighting
- removed daemon keyword
closes: vim/vim#18355
https://github.com/vim/vim/commit/11bde1f16939ef4128d08488ae238c66b46aa056
Co-authored-by: Bjoern Foersterling <bjoern.foersterling@gmail.com>
|
|
and ${|cmd;}
bash 5.3 (released July 2025) added support for ${ cmd;} and
${|cmd;} style command substitution, which is similar (but not
identical) to ksh/mksh.
closes: vim/vim#18084
https://github.com/vim/vim/commit/e06d81fe675794d6e849cfa78e31a78c8001bbe5
Co-authored-by: Kevin Pulo <kevin.pulo@mongodb.com>
|
|
closes: vim/vim#17785
https://github.com/vim/vim/commit/ba3a5a7372e7e41ef0153d05295b97bb06b57342
Co-authored-by: Christoffer Aasted <chr.aasted@gmail.com>
|
|
value in syntax script
fixes: vim/vim#10701
closes: vim/vim#17557
https://github.com/vim/vim/commit/152a450d88532ef9a352e0e9c9d8f4b7a491191b
Co-authored-by: hakkadaikon <hakkadaikon@yahoo.co.jp>
|
|
ksh93 scripts
- Fixed syntax highlighting for ksh93 namespace variables starting
with '${.'
- Added support for the alarm, eloop, fds, mkservice, pids, poll and
sha2sum builtins (which are indeed ksh93 builtins, albeit whether or
not they are available depends on the ksh release and the compiled
SHOPT options).
- Added support for the many Unix commands provided by ksh93's libcmd
as builtin commands (since these are general commands, scripts for
other shells like bash will also highlight these).
- The dumps for the sh_0{2,5,6,8,9}.sh were recreated due to this
change affecting commands those scripts call (e.g. 'wc').
- Enabled ${parameter/pattern/string} and friends for ksh syntax.
- Enabled case modification for ksh. See also:
https://github.com/ksh93/ksh/commit/c1762e03
- Enabled ;;& support for ksh. See also:
https://github.com/ksh93/ksh/commit/fc89d20a
- Added many special ksh variables using 93u+m's data/variables.c
as a reference.
If vim can't figure out which ksh release is in play using e.g.
the hashbang path, in such a case a generic default that enables
everything and the kitchen sink will be used. Otherwise, features will
be disabled if it's absolutely known a certain feature will not be
present. Examples:
- ERRNO is ksh88 specific, so that is locked to ksh88.
- Only 93u+m (assumed for generic) has SRANDOM, and only 93u+m
and 93v- have case modification support.
- 93u+ and 93v- have VPATH and CSWIDTH variables (the latter
is vestigal, but still present in the hardcoded variable table).
- 93v- and ksh2020 have (buggy and near unusable) implementations
of compgen and complete.
- Only mksh provides function substitutions, i.e. ${|command;}.
This took the better part of my day to implement. It seems to work well
enough though. (Also had to regenerate the dumps again while testing
it, as now there are dup scripts with mere hashbang differences, used
solely for testing syntax highlighting differences.)
closes: vim/vim#17348
https://github.com/vim/vim/commit/b0691b46bd684940efe2ebd56db0ca1c38b02a34
Co-authored-by: Johnothan King <johnothanking@protonmail.com>
|
|
class matching
- Default to POSIX supported classes.
- Add a KornShell specific class list.
- Remove "or" from the Bash class list, presumably a typo.
closes: vim/vim#17293
https://github.com/vim/vim/commit/839b79eeb33a41a5b368ad56aeaaa94f5fbace92
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
|
|
closes: vim/vim#17268
https://github.com/vim/vim/commit/87947a9a769ad43216beae7946c8b0bda9f8024a
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
|
|
parameter expansions
Ignore single-quoted backslash escape sequences in parameter expansions.
\' is not an escaped single quote in ${foo:-'word\'}.
closes: vim/vim#17261
https://github.com/vim/vim/commit/fe22867ef564ea78cafaabe0c784222638399cb9
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
|
|
test expressions (#33757)
Highlight escape characters in unquoted test expression operands.
E.g., [[ foo == \[bar\] ]]
fixes vim/vim#17221
https://github.com/vim/vim/commit/f57c065e7572beb2b551d1278bf794f4af0fb0c0
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
|
|
robust (#33421)
closes: vim/vim#17063
https://github.com/vim/vim/commit/5c84d12df104e976e8f56c43f9f975e54d9fd779
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
|
|
opening paren at EOL
Allow the opening parenthesis of a command substitution to appear at
EOL.
This fixes the issue raised in
https://github.com/vim/vim/issues/17026#issuecomment-2774112284.
closes: vim/vim#17044
https://github.com/vim/vim/commit/6099db9a60d1c047bf9c8feee3e1689c4e653250
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
|
|
Also, do not set g:is_kornshell when g:is_posix is set. BSD shells are
POSIX but many are derived from the ash shell.
closes: vim/vim#16939
https://github.com/vim/vim/commit/51a06ecee06096672b2f10fc6cd76bd8f6dfe8c9
Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
|
|
- remove duplicated keywords
- add bash coproc and COPROC_PID keywords
https://github.com/vim/vim/commit/54cb514c9a8320d77650a63f0f7405aa8cc5b0d7
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
|
|
related: vim/vim#16394
https://github.com/vim/vim/commit/3159b6494ec08fbe780d14e54ad4e89e7b55bb16
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
PS0 is also a special prompt variable. (It is expanded and displayed
after it reads a command but before executing it.)
References:
https://www.gnu.org/software/bash/manual/html_node/Interactive-Shell-Behavior.html
closes: vim/vim#16394
https://github.com/vim/vim/commit/cf1f55548d1c8782c5bd11f82354d98fb30cde42
Co-authored-by: Jon Parise <jon@indelible.org>
|
|
- Define a general non-"contained" "shBracketExpr" group,
and replace with it the "contained" bracket variant of
"shOperator", adjusting the patterns for the competing
conditional commands "[" and "[[".
- Accommodate some unbalanced brackets (e.g. "[!][!]").
- Make the leading "!" (or "^") stand out in NON-matching
bracket expressions.
- Support literal newlines in parametric patterns (along
with pathname globbings and "case" patterns).
- Also match bracket expressions in:
* parametric patterns (e.g. "${1#[ab]_}");
* pathname globbings (e.g. "[ab]*.txt");
* arguments for the "[[", "echo", and "print" commands.
- Recognise collating symbols (e.g. "[.a.]") and equivalence
classes (e.g. "[=a=]").
- Recognise end patterns for a pattern substitution form of
parameter expansion and match bracket expressions in such
patterns (e.g. "${1/%[.!]/;}").
fixes vim/vim#15799
closes: vim/vim#15941
References:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_03_05
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_14
https://git.savannah.gnu.org/gitweb/?p=bash.git;a=blob_plain;f=doc/bash.html;hb=37b7e91d64ad10b1a1815d12128c9475636df670
http://www.mirbsd.org/htman/i386/man1/mksh.htm
https://github.com/vim/vim/commit/48fa3198b7118023fea4b15015a97c920887eb07
Co-authored-by: Aliaksei Budavei <0x000c70@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.
https://github.com/vim/vim/commit/1bdc9435c1a14ca1a30e5b5927ab63f603ec4409
Co-authored-by: dkearns <dougkearns@gmail.com>
|
|
runtime(misc): announce adoption of various runtime files
https://github.com/vim/vim/commit/f9ca139e3aa12dd03177ebba5eedcee4f0836f27
Co-authored-by: Christian Brabandt <cb@256bit.org>
|
|
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#9514
https://github.com/vim/vim/commit/add31baedaf03b92dbd41427860c61c639ef705c
Co-authored-by: Johnothan King <johnothanking@protonmail.com>
|
|
runtime(sh): Update sh syntax and add local keyword for bash (vim/vim#13806)
add `local` in shStatement
https://github.com/vim/vim/commit/b16fc9805535dc6eb084142da0c87210fc102494
Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
|
|
runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash (vim/vim#13480)
Add shDerefOffset to shDerefVarArray.
Example code:
```bash
declare -a a=({a..z})
echo "${a[@]:1:3}"
```
https://github.com/vim/vim/commit/ce3b0136c6d9d09af41969d3dc9634f115505a32
Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
|
|
runtime(sh) Update sh syntax and add shDblParen to shCaseList (vim/vim#13469)
https://github.com/vim/vim/commit/1858e2b22ad168b1fd44a4efcd3a2b6cd9f6772d
Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
|
|
runtime(sh): add shDblParen to shLoopList for bash (vim/vim#13445)
add shDblParen to shLoopList to correctly highlight
arithmetic expressions for Bash and Ksh
This should allow code such as:
```bash
declare -i i j
for i in foo bar
do ((j = 1 << j))
done
```
https://github.com/vim/vim/commit/a390e984db20575dc726b4e0ebf95582265df8e7
Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
|
|
Update runtime files
https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
vim-patch:partial:dd60c365cd26
Update runtime files
https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
|
|
Update runtime files.
https://github.com/vim/vim/commit/be4e01637e71c8d5095c33b9861fd70b41476732
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
Update runtime files
https://github.com/vim/vim/commit/86b4816766d976a7ecd4403eca1f8bf6b4105800
vim-patch:9.0.1029: autoload directory missing from distribution
Problem: Autoload directory missing from distribution.
Solution: Add the autoload/zig directory to the list of distributed files.
https://github.com/vim/vim/commit/84dbf855fb2d883481f74ad0ccf3df3f8837e6bf
Co-authored-by: Bram Moolenaar <Bram@vim.org>
|
|
Update runtime files
https://github.com/vim/vim/commit/0daafaa7d99ef500f76b1b12f5fe8153e2fcaea0
skip vim9script ftplugin
create userfunc.txt from Neovim content (skip section 3, needs 9.0.0379)
|
|
Update runtime files
https://github.com/vim/vim/commit/5ed11535e0695163cec71033b98bb97356cf0113
|
|
Update runtime files.
https://github.com/vim/vim/commit/6ba83ba9ee292f68aa0b218b3eef42db31c0b632
|
|
Update runtime files
https://github.com/vim/vim/commit/113cb513f76d8866cbb6dc85fa18aded753e01da
skip doc/eval.txt
skip doc/insert.txt
skip doc/user_06.txt (needs 8.2.3562)
partial skip doc/syntax.txt (needs 8.2.3562)
|
|
Update runtime files
https://github.com/vim/vim/commit/d2ea7cf10a4d026ebd402594d656af7d5c811c24
omit `runtime/doc/if_tcl.txt`
omit `runtime/doc/textprop.txt`
omit `runtime/tutor/*`
omit `runtime/syntax/vim.vim` (cherry-picked in https://github.com/neovim/neovim/commit/2dd7828511d04a8b7f1ac4331c719a751a5db869)
manual merge of `runtime/pack/dist/opt/termdebug/plugin/termdebug.vim`
|
|
Update runtime files
https://github.com/vim/vim/commit/23515b4ef7580af8b9d3b964a558ab2007cacda5
Omit filetype.txt changes for :Man.
|
|
Update runtime files.
https://github.com/vim/vim/commit/d58a3bf7dac8d53faf42e13cc1152b110f12c404
Omit syntax/man.vim.
|
|
Update runtime files
https://github.com/vim/vim/commit/47e13953ffdbb9f163b901196dec8c2100b72edd
Ignore *.rej files, generated by vim-patch.sh.
Source of mistakes for 1st-time contributors.
|
|
Update runtime files.
https://github.com/vim/vim/commit/1d9215b9aaa120b9d78fee49488556f73007ce78
|
|
Update runtime files
https://github.com/vim/vim/commit/6c1e1570b1346de0d438fbb991bddab38c228290
|
|
Update runtime files.
https://github.com/vim/vim/commit/723dd946f94856be94a943876945fb1bd8169059
|
|
Update runtime files
https://github.com/vim/vim/commit/b730f0c7ba36492d795f081b19bbcb85cdf0f50f
|
|
Update runtime files.
https://github.com/vim/vim/commit/93a1df2c205c8399d96c172d9483e0793d32892a
|
|
Update runtime files.
https://github.com/vim/vim/commit/d2855f5454c5c6c5f786b228c5b67757edfefcb1
|
|
Update runtime files
https://github.com/vim/vim/commit/51ad4eaa22e15cf1fe6c45d82c7e1371e00401a4
---
NA:
vim-patch:6176697203b0
|
|
Update runtime files.
https://github.com/vim/vim/commit/b0d45e7f5354375edd02afafde3bd37dac1515ff
|