vim-hjson icon indicating copy to clipboard operation
vim-hjson copied to clipboard

`]` and `}` are highlighted differently from their corresponding opening brackets

Open belkka opened this issue 2 years ago • 0 comments

Apparently, syntax highlighting assumes presence of commas between list elements, which are optional in hjson.

I expect a closing bracket (of a list or object) to be displayed in same colors as a corresponding opening bracket.

Instead, closing } of some objects within a list AND the ] of that list are highlighted rather like string literals (at least in my colorscheme). To be precise, wrong } highlighting happens for objects:

  1. followed by another object or string, but
  2. not separated from it with comma nor comment.

Sample

According to https://hjson.github.io/try.html, this is a valid list of 6 elements — 5 objects and 1 string:

[
    {x:1}
    {y:2} {z:3}
    {z:4}
    "You are in a debris room filled with stuff washed in from the surface."
    {y:5}
]

Demo

asciicast

belkka avatar Dec 25 '23 07:12 belkka