Closed lmerz1 closed 1 month ago
Perhaps also interestingly, when adding quotes to the EOF
symbol, which means "interpret the following block literally and do not substitute any values", the now-not-a-variable-anymore ${1}
doesn't trigger the incorrect highlighting.
Edit: did not mean to close, oops.
I believe heredoc highlighting in bash was recently fixed in #11118
Thanks. You would of course be correct. I didn't recall the name of the construct which is why searching for this issue didn't work for me. :-)
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 (2cadec0b)