zjhmale / intellij-clojure-pretty-symbol

Pretty symbols for your Clojure development with IntelliJ IDEA
39 stars 2 forks source link

let symbol is reset to let form when bindings are laying each on its line #4

Closed rssole closed 8 years ago

rssole commented 8 years ago

This might not be an issue...maybe it is intentional but anyway for you to be aware for me in IDEA 15 with CPS 1.4, given: (let [x 2 y 3]... let is replaced with symbol. However, if I put each binding on its own line like

(let [x 2
       y 3]...

symbol turns back to "let"...

If this is intentional then just close this issue.

Cheers!

zjhmale commented 8 years ago

@rssole this is intentional cause if it dose not turns back to "let" it will cause a Indent error.

(let [a 1
      b 2])
(⊢ [a 1
       b 2])

so when the left and right delimiters not matching, the pretty symbols will not showing, so does letfn, not=, doseq etc.

rssole commented 8 years ago

Ok right, makes sense :)

tylerperkins commented 8 years ago

How about this solution: In the few problematic indentation cases like let, just pad the pretty symbol with spaces so it doesn't disturb horizontal placement of text to the right. So

(let [

(six chars.) would be appear as

( ⊢  [

(also six chars.) I.e. "let" becomes " ⊢ " (note one space before ⊢ and one after, then the already-existing space comes after that). The result is the same size, but it's still small (since "let" is small), and there is less visual clutter. Besides, it's optional, of course!

zjhmale commented 8 years ago

@tylerperkins good point! i will try to add it later :)