64 Commits

Author SHA1 Message Date
6976ff57dd vim-patch:152a450: runtime(sh): reset g:sh_fold_enabled after outputting its value in syntax script
fixes: vim/vim#10701
closes: vim/vim#17557

152a450d88

Co-authored-by: hakkadaikon <hakkadaikon@yahoo.co.jp>
2025-06-17 10:44:37 +02:00
172a90c245 vim-patch:b0691b4: runtime(sh): Fix various syntax highlighting problems in 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

b0691b46bd

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2025-05-22 08:56:01 +02:00
1826ad16af vim-patch:839b79e: runtime(sh): Update syntax, improve wildcard character 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

839b79eeb3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-11 10:47:39 +02:00
186851b1bd vim-patch:87947a9: runtime(sh): Update syntax, match KornShell compound arrays
closes: vim/vim#17268

87947a9a76

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-07 09:46:01 +08:00
45e9054813 vim-patch:fe22867: runtime(sh): Update syntax, fix single-quoted strings in parameter expansions
Ignore single-quoted backslash escape sequences in parameter expansions.

\' is not an escaped single quote in ${foo:-'word\'}.

closes: vim/vim#17261

fe22867ef5

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-07 09:45:34 +08:00
dd71a21463 vim-patch:f57c065: runtime(sh): Update syntax, highlight escaped chars in test expressions (#33757)
Highlight escape characters in unquoted test expression operands.

E.g., [[ foo == \[bar\] ]]

fixes vim/vim#17221

f57c065e75

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-05-02 07:25:58 +08:00
3aa833e0d9 vim-patch:5c84d12: runtime(filetype): make shell filetype detection more robust (#33421)
closes: vim/vim#17063

5c84d12df1

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-04-11 16:45:14 +08:00
b788c7fa6c vim-patch:6099db9: runtime(sh): Update syntax file, command substitution 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

6099db9a60

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-04-04 10:43:18 +02:00
c5044bd021 vim-patch:51a06ec: runtime(sh): consider sh as POSIX shell by default (#33078)
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

51a06ecee0

Co-authored-by: Mohamed Akram <mohd.akram@outlook.com>
2025-03-27 11:22:22 +08:00
7d04ebd43c vim-patch:54cb514: runtime(sh): update syntax script
- remove duplicated keywords
- add bash coproc and COPROC_PID keywords

54cb514c9a

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2025-01-18 11:48:35 +01:00
4d94059919 vim-patch:3159b64: runtime(sh): fix typo in Last Change header
related: vim/vim#16394

3159b6494e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-01-07 08:03:13 +01:00
b44a8ba1e7 vim-patch:cf1f555: runtime(sh): add PS0 to bashSpecialVariables in syntax script
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

cf1f55548d

Co-authored-by: Jon Parise <jon@indelible.org>
2025-01-07 08:03:13 +01:00
259573db83 vim-patch:48fa319: syntax(sh): Improve the recognition of bracket expressions
- 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

48fa3198b7

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2024-12-30 12:11:11 +01:00
66c9f987e7 vim-patch:1bdc9435c1a1
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>
2024-03-04 23:03:09 +01:00
9bb046d1be vim-patch:f9ca139e3aa1 (#27554)
runtime(misc): announce adoption of various runtime files

f9ca139e3a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-02-21 06:30:18 +08:00
46aa1936e4 vim-patch:add31baedaf0
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

add31baeda

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2024-01-22 23:40:50 +01:00
b8df4b2dff vim-patch:b16fc9805535
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>
2024-01-02 11:43:18 +01:00
d3e9cbedc7 vim-patch:ce3b0136c6d9
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}"
```

ce3b0136c6

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-04 12:55:54 +01:00
d4dc1355ed vim-patch:1858e2b22ad1
runtime(sh) Update sh syntax and add shDblParen to shCaseList (vim/vim#13469)

1858e2b22a

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-11-03 10:04:55 +01:00
a5629abce2 vim-patch:a390e984db20
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
```

a390e984db

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2023-10-29 01:37:07 +02:00
e3f36377c1 vim-patch:71badf9547e8 (#23285)
Update runtime files

71badf9547

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-04-23 15:22:55 +02:00
66c384d4e8 vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26

Update runtime files

dd60c365cd

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
2023-02-28 09:34:27 +01:00
144279ef30 vim-patch:be4e01637e71 (#22103)
Update runtime files.

be4e01637e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-03 09:18:18 +01:00
3576776903 vim-patch:86b4816766d9 (#21314)
Update runtime files

86b4816766

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.

84dbf855fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-12-08 16:33:38 +01:00
4bf005e9fd vim-patch:partial 0daafaa7d99e (#20083)
Update runtime files
0daafaa7d9

skip vim9script ftplugin
create userfunc.txt from Neovim content (skip section 3, needs 9.0.0379)
2022-09-06 08:57:53 +02:00
55e81b0fe8 vim-patch:5ed11535e069 (#19256)
Update runtime files
5ed11535e0
2022-07-07 08:15:33 +02:00
2f2022773f vim-patch:6ba83ba9ee29 (#18948)
Update runtime files.
6ba83ba9ee
2022-06-14 08:52:04 +02:00
8cbe100fcc vim-patch:partial 113cb513f76d (#16260)
Update runtime files
113cb513f7

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)
2021-11-08 00:10:44 +01:00
79cbbd5179 vim-patch:d2ea7cf10a4d #15571
Update runtime files
d2ea7cf10a

omit `runtime/doc/if_tcl.txt`
omit `runtime/doc/textprop.txt`
omit `runtime/tutor/*`
omit `runtime/syntax/vim.vim` (cherry-picked in 2dd7828511)

manual merge of `runtime/pack/dist/opt/termdebug/plugin/termdebug.vim`
2021-09-08 07:24:12 -07:00
83b6a18598 vim-patch:23515b4ef758
Update runtime files
23515b4ef7

Omit filetype.txt changes for :Man.
2021-05-01 22:29:03 -04:00
e1171cf1d2 vim-patch:d58a3bf7dac8
Update runtime files.
d58a3bf7da

Omit syntax/man.vim.
2021-05-01 02:01:25 -04:00
0185625c04 vim-patch:47e13953ffdb
Update runtime files
47e13953ff

Ignore *.rej files, generated by vim-patch.sh.
Source of mistakes for 1st-time contributors.
2021-04-28 21:29:57 -04:00
e8178093dc vim-patch:1d9215b9aaa1
Update runtime files.
1d9215b9aa
2021-04-27 09:21:34 -04:00
0d852bdc69 vim-patch:6c1e1570b134
Update runtime files
6c1e1570b1
2019-08-02 16:20:22 +02:00
31a5ec23eb vim-patch:723dd946f948
Update runtime files.
723dd946f9
2019-08-01 22:52:42 +02:00
ab2cfd24e7 vim-patch:b730f0c7ba36
Update runtime files
b730f0c7ba
2019-07-29 20:50:07 +02:00
7d2fbb9012 vim-patch:93a1df2c205c
Update runtime files.
93a1df2c20
2018-10-29 23:57:24 +01:00
4f67f5ba6e vim-patch:d2855f5454c5
Update runtime files.
d2855f5454
2018-10-29 09:57:24 +01:00
a1e822fbc6 vim-patch:51ad4eaa22e1
Update runtime files
51ad4eaa22

---

NA:
vim-patch:6176697203b0
2018-10-29 08:26:47 +01:00
2ca59638ba vim-patch:b0d45e7f5354
Update runtime files.

b0d45e7f53
2017-11-07 23:07:03 +01:00
deccd843ed vim-patch:3df0173fa6d0
Updated runtime files.

3df0173fa6
2017-05-01 13:32:51 +02:00
ac107f7fdd vim-patch:690afe1fef87
Update runtime files.

690afe1fef
2017-05-01 13:23:12 +02:00
1e7806bd41 vim-patch:6d5ad4c4118c
Updated runtime files.

6d5ad4c411
2017-04-29 01:49:36 +02:00
40fb96c76a vim-patch:3e496b0ea319
Updated runtime files.

3e496b0ea3

NA patches:
vim-patch:8.0.0015
vim-patch:8.0.0016
vim-patch:177778575148
2017-04-28 23:39:24 +02:00
86b596dc7a vim-patch:f37506f60f87
Updated runtime files.  Remove HiLink commands.

f37506f60f
2017-04-28 21:25:15 +02:00
a53409b564 vim-patch:89bcfda6834a
Updated runtime files.  Remove version checks for Vim older than 6.0.

89bcfda683
2017-04-28 21:13:55 +02:00
409e56b139 vim-patch:818078ddfbb8
Updated runtime files and translations.

818078ddfb
2017-04-28 21:01:25 +02:00
d194380de9 vim-patch:e4a3bcf28d92
Updated runtime files.  Add Scala files.

e4a3bcf28d
2017-04-19 21:26:17 +02:00
cc421270ee vim-patch:bc8801c9317eb
Updated runtime files.

bc8801c931
2017-03-21 12:19:17 +01:00
4e47568f89 vim-patch:802a0d9
Updated runtime files.

802a0d902f
2017-02-01 18:34:57 -05:00