Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
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

Open

Description

@hwittenborn

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

Activity

  1. ladar commented on Dec 14, 2021

    @ladar

    @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.

  2. hwittenborn commented on Dec 17, 2021

    @hwittenborn
    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.

  3. ladar commented on Dec 19, 2021

    @ladar

    @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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions