runtime(sh): Update syntax file, fix issue #962 (#14138)

Commit: 
https://github.com/vim/vim/commit/1bdc9435c1a14ca1a30e5b5927ab63f603ec4409
Author: dkearns <[email protected]>
Date:   Tue Mar 5 05:14:08 2024 +1100

    runtime(sh): Update syntax file, fix issue 
https://github.com/vim/vim/issues/962 (https://github.com/vim/vim/issues/14138)
    
    Allow the opening parenthesis of a multiline array assignment, within an
    if statement, to appear at EOL.
    
    Fixes issue #962.
    
    Signed-off-by: Doug Kearns <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 4c591736b..97e74d205 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -3,8 +3,7 @@
 " Maintainer:          This runtime file is looking for a new maintainer.
 " Previous Maintainers:        Charles E. Campbell
 "              Lennart Schultz <[email protected]>
-" Last Change:         Feb 28, 2023
-"   2024 Feb 19 by Vim Project (announce adoption)
+" Last Change:         2024 Mar 04 by Vim Project
 " Version:             208
 " Former URL:          http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
 " For options and settings, please use:      :help ft-sh-syntax
@@ -354,7 +353,7 @@ if exists("b:is_kornshell") || exists("b:is_bash") || 
exists("b:is_posix")
 elseif !exists("g:sh_no_error")
  syn region shCommandSub matchgroup=Error start="\$(" end=")" 
contains=@shCommandSubList
 endif
-syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(\ze[^(]" 
skip='\\\|\.' end=")" contains=@shCommandSubList
+syn region shCmdParenRegion matchgroup=shCmdSubRegion start="((\@!" 
skip='\\\|\.' end=")" contains=@shCommandSubList
 
 if exists("b:is_bash")
  syn cluster shCommandSubList add=bashSpecialVariables,bashStatement
diff --git a/runtime/syntax/testdir/dumps/sh_11_00.dump 
b/runtime/syntax/testdir/dumps/sh_11_00.dump
new file mode 100644
index 000000000..f2d1d270d
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/sh_11_00.dump
@@ -0,0 +1,20 @@
+>#+0#0000e05#ffffff0|!|/|b|i|n|/|b|a|s|h| +0#0000000&@63
+@75
+|#+0#0000e05&| |I|s@1|u|e| |#|9|6|2| +0#0000000&@62
+@75
+|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&| +0#0000000&@69
+@2|1+0#e000002&| +0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| 
+0#0000000&|4+0#e000002&| +0#0000000&@65
+|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |o|k| +0#0000000&@68
+@75
+|i+0#af5f00255&|f| |t|r|u|e|;| +0#0000000&|t+0#af5f00255&|h|e|n| +0#0000000&@61
+@75
+@2|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&|1+0#e000002&| 
+0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| 
+0#0000000&|4+0#e000002&|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |o|k| 
+0#0000000&@54
+@75
+@2|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&| +0#0000000&|1+0#e000002&| 
+0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| +0#0000000&|4+0#e000002&| 
+0#0000000&|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |o|k| +0#0000000&@52
+@75
+@2|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&| +0#0000000&@67
+@4|1+0#e000002&| +0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| 
+0#0000000&|4+0#e000002&| +0#0000000&@63
+@2|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |p|a|r|e|n| |e|r@1|o|r|!| 
+0#0000000&@56
+@75
+|f+0#af5f00255&|i| +0#0000000&@72
+|i|s|_|b|a|s|h|:| |1|,| @45|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/sh_11_99.dump 
b/runtime/syntax/testdir/dumps/sh_11_99.dump
new file mode 100644
index 000000000..9612dab33
--- /dev/null
+++ b/runtime/syntax/testdir/dumps/sh_11_99.dump
@@ -0,0 +1,20 @@
+| +0&#ffffff0@74
+|#+0#0000e05&| |I|s@1|u|e| |#|9|6|2| +0#0000000&@62
+@75
+|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&| +0#0000000&@69
+@2|1+0#e000002&| +0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| 
+0#0000000&|4+0#e000002&| +0#0000000&@65
+|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |o|k| +0#0000000&@68
+@75
+|i+0#af5f00255&|f| |t|r|u|e|;| +0#0000000&|t+0#af5f00255&|h|e|n| +0#0000000&@61
+@75
+@2|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&|1+0#e000002&| 
+0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| 
+0#0000000&|4+0#e000002&|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |o|k| 
+0#0000000&@54
+@75
+@2|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&| +0#0000000&|1+0#e000002&| 
+0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| +0#0000000&|4+0#e000002&| 
+0#0000000&|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |o|k| +0#0000000&@52
+@75
+@2|a+0#00e0e07&|r@1|=+0#0000000&|(+0#e000e06&| +0#0000000&@67
+@4|1+0#e000002&| +0#0000000&|2+0#e000002&| +0#0000000&|3+0#e000002&| 
+0#0000000&|4+0#e000002&| +0#0000000&@63
+@2|)+0#e000e06&| +0#0000000&|#+0#0000e05&| |p|a|r|e|n| |e|r@1|o|r|!| 
+0#0000000&@56
+@75
+|f+0#af5f00255&|i| +0#0000000&@72
+> @74
+@57|2|0|,|0|-|1| @7|B|o|t| 
diff --git a/runtime/syntax/testdir/input/sh_11.sh 
b/runtime/syntax/testdir/input/sh_11.sh
new file mode 100755
index 000000000..6e192fc3c
--- /dev/null
+++ b/runtime/syntax/testdir/input/sh_11.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Issue #962
+
+arr=(
+  1 2 3 4
+) # ok
+
+if true; then
+
+  arr=(1 2 3 4) # ok
+
+  arr=( 1 2 3 4 ) # ok
+
+  arr=(
+    1 2 3 4
+  ) # paren error!
+
+fi
+

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1rhCqA-00H2n6-1r%40256bit.org.

Raspunde prin e-mail lui