[PATCH v3 0/9] syntax: sh: heredoc fixes

36 views
Skip to first unread message

Felipe Contreras

unread,
Oct 19, 2020, 8:16:15 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
Hi,

There are a lot of issues with the sh syntax for heredoc, these patches
attempt to solve them. I counted at least eight bugs fixed.

It has been *six* years since I originally sent the patches and many of the
issues still remain.

You can open this file and see for yourself.

double='DDOUBLE'

# 01
cat <<EOF
this is $double
EOF
cat << EOF
this is $double
EOF

# 02
cat <<-EOF
this is $double
EOF
cat <<- EOF
this is $double
EOF

# 03
cat <<\EOF
this is $single
EOF
# BUG 2
cat << \EOF
this is $single
EOF

# 04
# BUG 1
cat <<-\EOF
this is $single
EOF
cat <<- \EOF
this is $single
EOF

# 05
cat <<'EOF'
this is $single
EOF
cat << 'EOF'
this is $single
EOF

# 06
cat <<-'EOF'
this is $single
EOF
cat <<- 'EOF'
this is $single
EOF

# 07
cat <<"EOF"
this is $single
EOF
cat << "EOF"
this is $single
EOF

# 08
cat <<-"EOF"
this is $single
EOF
cat <<- "EOF"
this is $single
EOF

# 09
cat <<\
EOF
this is $double
EOF
cat <<\
EOF
this is $double
EOF

# 10
# BUG 3
cat <<-\
EOF
this is $double
EOF
cat <<- \
EOF
this is $double
EOF

# BUG 4
# 11
cat <<\
\EOF
this is $single
EOF
cat << \
\EOF
this is $single
EOF

# 12
cat <<-\
\EOF
this is $single
EOF
cat <<- \
\EOF
this is $single
EOF

# 13
cat <<\
'EOF'
this is $single
EOF
# BUG 5
cat <<\
'E O F'
this is $single
E O F
cat << \
'E O F'
this is $single
E O F

# 14
cat <<-\
'EOF'
this is $single
EOF
cat <<-\
'E O F'
this is $single
E O F
cat <<- \
'E O F'
this is $single
E O F

# 15
cat <<\
"EOF"
this is $single
EOF
cat <<\
"E O F"
this is $single
E O F
cat << \
"E O F"
this is $single
E O F

# 16
cat <<-\
"EOF"
this is $single
EOF
cat <<-\
"E O F"
this is $single
E O F
cat <<- \
"E O F"
this is $single
E O F


Felipe Contreras (9):
syntax: sh: fix doublequote regression in heredoc
syntax: sh: fix quote style in heredoc
syntax: sh: fix unmatched syntax
syntax: sh: remove duplicate syntax
syntax: sh: fix heredoc match
syntax: sh: remove extra heredoc match
syntax: sh: add missing match
syntax: sh: reorganize heredocs
syntax: sh: cleanup matches

runtime/syntax/sh.vim | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)

--
2.28.0

Felipe Contreras

unread,
Oct 19, 2020, 8:16:17 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
Version 188 screwed up the handling of quotes: \EOF is not supposed to
be interpreted as double quotes.

Because of that change all of these fail while they didn't before:

# 07
cat <<\
EOF
this is $double
EOF

# 11
cat <<-\
\EOF
this is $single
EOF

# 14
cat <<\EOF
this is $single
EOF

# 15(16)
cat <<-\EOF
this is $single
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index b66805633..a15fe8fe3 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -396,23 +396,22 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup

" Here Documents: {{{1
" =========================================
-" Note : shHereDoc0[137] only had shDblQuoteList contained
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t'"|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t'"|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^\t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^\t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" contains=@shDblQuoteList
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" contains=@shDblQuoteList
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"

" Here Strings: {{{1
" =============
--
2.28.0

Felipe Contreras

unread,
Oct 19, 2020, 8:16:18 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
This was using the wrong quote style (single instead of double):

# 10
cat <<-\
EOF
this is $double
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index a15fe8fe3..35e11f0c7 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -405,7 +405,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t'"|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^\t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^\t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
--
2.28.0

Felipe Contreras

unread,
Oct 19, 2020, 8:16:19 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
This wasn't working correctly (the EOF part isn't highlighted):

# 16
cat <<-\EOF
this is $single
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 35e11f0c7..b2a1df877 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -411,7 +411,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\s*\z1\s*$"

" Here Strings: {{{1
" =============
@@ -755,6 +755,7 @@ if !exists("skip_sh_syntax_inits")
hi def link shHereDoc13 shRedir
hi def link shHereDoc14 shRedir
hi def link shHereDoc15 shRedir
+ hi def link shHereDoc16 shRedir
endif

" Delete shell folding commands {{{1
--
2.28.0

Felipe Contreras

unread,
Oct 19, 2020, 8:16:21 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 --
1 file changed, 2 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index b2a1df877..634502051 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -411,7 +411,6 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\s*\z1\s*$"

" Here Strings: {{{1
" =============
@@ -755,7 +754,6 @@ if !exists("skip_sh_syntax_inits")
hi def link shHereDoc13 shRedir
hi def link shHereDoc14 shRedir
hi def link shHereDoc15 shRedir
- hi def link shHereDoc16 shRedir

Felipe Contreras

unread,
Oct 19, 2020, 8:16:23 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
The spaces where missing (' \EOF'), so this wasn't working correctly:

# 14
cat << \EOF
this is $single
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 634502051..ec6a3b7db 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -409,7 +409,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"

" Here Strings: {{{1
--
2.28.0

Felipe Contreras

unread,
Oct 19, 2020, 8:16:24 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
shHereDoc14 is already catching the backslash which makes the match functionally
different, as it should be: \EOF is different from EOF.

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index ec6a3b7db..531498701 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -396,7 +396,7 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup

" Here Documents: {{{1
" =========================================
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
--
2.28.0

Felipe Contreras

unread,
Oct 19, 2020, 8:16:27 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
The unshifted version of shHereDoc11 was missing, so this fails:

cat <<\
\EOF
this is $single
EOF

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 3 +++
1 file changed, 3 insertions(+)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 531498701..2173f7539 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -411,6 +411,8 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\z1\s*$"
+

" Here Strings: {{{1
" =============
@@ -754,6 +756,7 @@ if !exists("skip_sh_syntax_inits")
hi def link shHereDoc13 shRedir
hi def link shHereDoc14 shRedir
hi def link shHereDoc15 shRedir
+ hi def link shHereDoc16 shRedir

Felipe Contreras

unread,
Oct 19, 2020, 8:16:28 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
Also standardize them.

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index ca55e09b1..ba4dc91e0 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -404,13 +404,13 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t'"|>]\+\)" matchgroup=shHereDoc09 end="^\z1\s*$" contains=@shDblQuoteList
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc09 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^\t|>]\+\)'" matchgroup=shHereDoc13 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc13 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^\t|>]\+\)\"" matchgroup=shHereDoc15 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc15 end="^\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1\s*$"


--
2.28.0

Felipe Contreras

unread,
Oct 19, 2020, 8:16:28 AM10/19/20
to vim...@googlegroups.com, Charles E . Campbell, Bram Moolenaar, Nikolay Pavlov, Felipe Contreras
So that it makes sense what we are trying to do.

No functional changes; just moving and renaming.

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
runtime/syntax/sh.vim | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 2173f7539..ca55e09b1 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -397,21 +397,21 @@ syn match shBQComment contained "#.\{-}\ze`" contains=@shCommentGroup
" Here Documents: {{{1
" =========================================
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc02 end="^\s*\z1\s*$" contains=@shDblQuoteList
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc04 end="^\s*\z1\s*$"
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t'"|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^\t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^\t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc06 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc07 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<-\s*\"\z([^"]\+\)\"" matchgroup=shHereDoc08 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\z([^ \t'"|>]\+\)" matchgroup=shHereDoc09 end="^\z1\s*$" contains=@shDblQuoteList
ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
-ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc16 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<\s*\\\_$\_s*'\z([^\t|>]\+\)'" matchgroup=shHereDoc13 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<-\s*\\\_$\_s*'\z([^']\+\)'" matchgroup=shHereDoc14 end="^\s*\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<\s*\\\_$\_s*\"\z([^\t|>]\+\)\"" matchgroup=shHereDoc15 end="^\z1\s*$"
+ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc16 start="<<-\s*\\\_$\_s*\"\z([^"]\+\)\"" matchgroup=shHereDoc16 end="^\s*\z1\s*$"

Christian Brabandt

unread,
Oct 19, 2020, 11:11:09 AM10/19/20
to vim...@googlegroups.com

On Mo, 19 Okt 2020, Felipe Contreras wrote:

> It has been *six* years since I originally sent the patches and many of the
> issues still remain.

Thanks for that. Have you contacted Dr. Chip (the syntax script
maintainer) and discussed the issue with him?

Best,
Christian
--
Ihr jubelt über die Macht der Presse - graut euch nie vor ihrer
Tyrannei?
-- Marie von Ebner-Eschenbach

Felipe Contreras

unread,
Oct 20, 2020, 9:05:28 PM10/20/20
to vim_dev
On Monday, October 19, 2020 at 10:11:09 AM UTC-5 Christian wrote:

On Mo, 19 Okt 2020, Felipe Contreras wrote:

> It has been *six* years since I originally sent the patches and many of the
> issues still remain.

Thanks for that. Have you contacted Dr. Chip (the syntax script
maintainer) and discussed the issue with him?

Yes. Multiple times, he is also CC'ed on these patches. 

BTW: I did not receive a copy of this mail, I had to look it up in Google groups web interface.
 

Christian Brabandt

unread,
Oct 26, 2020, 5:19:02 AM10/26/20
to vim_dev

On Di, 20 Okt 2020, Felipe Contreras wrote:

> Yes. Multiple times, he is also CC'ed on these patches.
>
> BTW: I did not receive a copy of this mail, I had to look it up in Google
> groups web interface.

I see. Sorry to hear that this issue still remains.


Best,
Christian
--
Die Dinge sind nicht immer so wie sie scheinen.
-- Greg Dyson
Reply all
Reply to author
Forward
0 new messages