scopatz / nanorc

Improved Nano Syntax Highlighting Files
Other
3k stars 549 forks source link

fix(hcl): only highlight keywords when they're actually keywords #363

Open G-Rath opened 3 years ago

G-Rath commented 3 years ago

Currently highlighting is being done in a simple text match fashion, i.e

terraform {
  required_providers {
    //
  }

  vault_value {
    //
  }
}

In the above, provider, vault, and value will all be incorrectly highlighted green.

This changes that so that they're only highlighted if they're not part of "other text" (I don't know the technical terms - not been able to find a good reference guide for the syntax :/)

Sadly, there's not really a lot we can do about having attributes like vault, but this is still an improvement