Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

[Bug] Variables aren't being highlighted correctly in PKGBUILD files #168

Open
hwittenborn opened this issue Jun 21, 2021 · 3 comments
Open

Comments

@hwittenborn
Copy link

After installing Atom on a new machine (with no extra extensions), I noticed that variable highlighting inside of PKGBUILD files doesn't look right:

image

It doesn't appear to be highlighting the ${} part, which should be happening. For example, this is what it looks like in a Bash .sh file:

image

@ladar
Copy link

ladar commented Dec 14, 2021

@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
Copy link
Author

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
Copy link

ladar commented 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, or bash shell script, then adding the standard to #!/bin/bash as the first line will fix it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants