Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: sh: Add here document as string region #2953

Merged
merged 1 commit into from
Oct 21, 2023

Conversation

JoeKar
Copy link
Collaborator

@JoeKar JoeKar commented Oct 6, 2023

This will treat a here document block with the limit string EOF as a string region.

Fixes #2949

@JoeKar
Copy link
Collaborator Author

JoeKar commented Oct 7, 2023

Further discussion/suggestions have been done here: #2949

The suggestion was to allow the usual and normal characters after << till $ as start marker and do the same for end marker with ^ till $. This would allow user defined "heredoc" marker other than EOF too, but highlights event then when start != end limit string. Like below:

start: "<<[^\\s]+[-~.]*[A-Za-z0-9]+$"
end: "^[^\\s]+[A-Za-z0-9]+$"

@zyedidia
Copy link
Owner

Yeah unfortunately the current highlighting engine is not powerful enough to handle heredocs properly. This is fine for handling the common case though. I would be fine with the extended version that matches even if the start/end don't match.

@JoeKar
Copy link
Collaborator Author

JoeKar commented Oct 16, 2023

I would be fine with the extended version that matches even if the start/end don't match.

Done.

@zyedidia zyedidia merged commit 041ee00 into zyedidia:master Oct 21, 2023
3 checks passed
@JoeKar JoeKar deleted the fix/sh-here-documents branch December 11, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants