This way, I reckon it is way easier to spot string as values vs keys!
Here are the regions highlighters currently defined in json.kak:
add-highlighter shared/json regions
add-highlighter shared/json/code default-region group
add-highlighter shared/json/string region '"' (?<!\\)(\\\\)*" fill string
add-highlighter shared/json/code/ regex \b(true|false|null|\d+(?:\.\d+)?(?:[eE][+-]?\d*)?)\b 0:value
I must admit that I’m very lame at writing regions delimiter and I failed to achieve what I depicted on the 2nd screenshot.
I gave it a shot. To me it seems it would be pretty difficult to handle JSON highlighting using regions in case such as this, so I ditched them and took regex only route:
Would also like a different colour for JSON keys! It looks like the recursive nature of JSON did in the PR. It looks to me that json.kak has not changed. Has there been any progress on this that I missed?
Meanwhile jq does a fine job highlighting JSON, nesting and all, in the terminal. However, the colours don’t survive piping jq into kak (unless jq is detecting which is at the other end of the pipe and going monochrome). Is there a way to make kakoune render terminal control characters (related to colour)?
This is not perfect either because it won’t correctly highlight any edits, but I find that I have to run JSON edits in kakoune through jq in any case to check for syntax errors, so perhaps it’s not that much of a drawback.