tonsky / Clojure-Sublimed

Clojure support for Sublime Text 4
MIT License
371 stars 22 forks source link

Parenthesis character literal is treated like list #66

Closed kyleerhabor closed 2 years ago

kyleerhabor commented 2 years ago

I don't know if this is the result of using alabaster, but given issues here and there, it may be coming from how Clojure Sublimed treats parentheses.

When using Clojure's character literal, it's displayed correctly for most characters. For lists, however, it seems to treat the parenthesis like a character and part of the form. For example, the following code prints Klay (#3), but highlights the character literal as part of the str form.

(def name "Klay")
(def lb-pos 3)
(println (str name " (#" lb-pos \)))
Screen Shot 2022-02-12 at 7 14 51 PM

It doesn't mess with the second to last parenthesis, but it's still unpleasant to see, especially when used in long, complicated forms where a single one of these can completely change the meaning for a reader.

tonsky commented 2 years ago

Sorry, I don’t understand what the problem is. It seems to be highlighted correctly? Pink if for constants and this is a constant, not a parenthesis

kyleerhabor commented 2 years ago

The colors are right, but the highlights (the parentheses underlined orange) are not. In the example above, the second to last parenthesis should be underlined, but the constant is instead, which is incorrect as it's being treated like it's part of the form call.

tonsky commented 2 years ago

Oh, I see! It’s called bracket matching and as far as I know Sublime uses its own algorithm for that, ignoring color scheme and syntax. I have no way to affect that. It annoys the hell out of me too, sometimes