Skip to content

Conversation

@steffenhaug
Copy link
Contributor

A lot of text editors recognize begin and end in array indices as keywords.
Granted, they probably do this because they are stupid and just highlight based on regex, but given that begin and end are special when used as array indices I think it makes sense to highlight them.

It might be sensible to highlight them as something else though, to distinguish them from their counterparts when used outside array indices. I'm open to suggestions.

@piechologist
Copy link
Collaborator

piechologist commented Sep 1, 2024

It's already in place, see lines 317:323. The trouble is the capture @variable.builtin which is not defined in Zed's default color themes. It falls back to @variable and that's probably just your default foreground color. You can experiment in your ~/.config/zed/settings.json:

{
  "experimental.theme_overrides": {
    "syntax": {
      "variable.special": { "color": "#ff0000" }
    }
  }
}

Reference: Zed docs

We're discussing how to make these customizations better visible (#13). A better default could help too 😆.

You may also be interested in this draft. Having a reference file for different editors would make the maintenance easier.

@steffenhaug
Copy link
Contributor Author

Oh, that was silly of me 🤦 Thanks for clarifying! It was indeed an issue with the theme.

@steffenhaug steffenhaug closed this Sep 1, 2024
@steffenhaug steffenhaug deleted the index-keywords-pr branch September 4, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants