Bash/Posix sh: Syntax highlighting wrong in specific cat << EOF
case
#11148
Labels
C-bug
Category: This is a bug
cat << EOF
case
#11148
Summary
Given a
heredoc block in a Unix shell script, syntax highlighting stops working for anything after the closing
EOF
if the[some text]
, seemingly only in the first line of the block, contains a single quote ('
) anywhere in the line and the line starts with a variable ($
as line's first character).I have tested this with different and the default themes, so it does not appear to be a theming issue.
From a quick test, my old-ish VSCodium I still keep around does not seem to exhibit this issue, so I don't think it's the language server. I might be wrong on that.
Reproduction Steps
Save the following as
repro.sh
and open it.Delete either the
'
,$
, or both in line 3 in order for the syntax highlighting to be correct again. Alternatively, add a second single quote anywhere before the closingEOF
.Notice how syntax highlighting also turns correct if you add another line with any non-empty content (even whitespace) above
${1}: text with quote'
– it really has to be these two characters (and with the single quote only occurring once or possibly an uneven number of times), and both occurring in the first line as described.Screenshots:
Edit: added more screenshots
Helix log
No response
Platform
macOS
Terminal Emulator
n/a (kitty and Hyper and Terminal.app)
Installation Method
brew
Helix Version
helix 24.3 (2cadec0)
The text was updated successfully, but these errors were encountered: