You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
[Bug] Variables aren't being highlighted correctly in PKGBUILD files #168
@hwittenborn not sure if your issue is related to mine, but I've noticed that files with #!/bin/bash -eu don't use the correct syntax highlighting grammar. Switching to #!/bin/bash fixes the issue. If you're having the same problem then updating the first line of the incorrectly highlighted file to match the correctly highlighted will cause the correct grammar to get used.
At least this will confirm what bug you're facing. No idea how to fix it... yet.
@hwittenborn my guess is the issues are related, in that a regex is used to associate a file with a language grammar. I found, and created a pull request to fix the grammar matching for sh/bash files. Not as familiar with PKGBUILD files. But if the first line doesn't match the regex, Atom falls back to a less extensive grammar match based solely on the filename, which in your case doesn't highlight the variables (among other issues).
If a PKGBUILD file is just an sh, or bash shell script, then adding the standard to #!/bin/bash as the first line will fix it.
Activity
ladar commentedon Dec 14, 2021
@hwittenborn not sure if your issue is related to mine, but I've noticed that files with
#!/bin/bash -eudon't use the correct syntax highlighting grammar. Switching to#!/bin/bashfixes the issue. If you're having the same problem then updating the first line of the incorrectly highlighted file to match the correctly highlighted will cause the correct grammar to get used.At least this will confirm what bug you're facing. No idea how to fix it... yet.
hwittenborn commentedon Dec 17, 2021
I'll see if I can try to reproduce on my machine some time, but I no longer use Atom, so it's not the top thing on my to-do list right now.
In that regard I'll leave it up to the maintainers of this repo to decide what to do with the issue.
ladar commentedon Dec 19, 2021
@hwittenborn my guess is the issues are related, in that a regex is used to associate a file with a language grammar. I found, and created a pull request to fix the grammar matching for sh/bash files. Not as familiar with PKGBUILD files. But if the first line doesn't match the regex, Atom falls back to a less extensive grammar match based solely on the filename, which in your case doesn't highlight the variables (among other issues).
If a PKGBUILD file is just an
sh, orbashshell script, then adding the standard to#!/bin/bashas the first line will fix it.