justinbarclay / parinfer-rust-mode

Simplifying how you write Lisp
https://shaunlebron.github.io/parinfer/
GNU General Public License v3.0
227 stars 16 forks source link

Single `"` in a comment breaks formatting #99

Closed narimiran closed 1 month ago

narimiran commented 1 month ago
; regular comment

{:ab :cd}
:ef :gh

Pressing space on the last line correctly produces:

; regular comment

{:ab :cd
 :ef :gh}

On the other hand, if a comment contains a single " character:

; a comment with "

{:ab :cd}
:ef :gh

Pressing space on the last line doesn't move } to the correct place:

; a comment with "

{:ab :cd}
 :ef :gh
justinbarclay commented 1 month ago

Thanks for reporting this. I can confirm this is a bug; unfortunately, I don't have any free time to look into this.

So, the best I can offer at the moment is a workaround in which escaping the quote works fine.

; a comment with \"
{:ab :cd
 :ef :gh}

I understand this could be better, however.

justinbarclay commented 1 month ago

Actually, looking into it slightly more, this is an intentional design of parinfer and, as such won't get fixed. https://github.com/eraserhd/parinfer-rust/issues/106

narimiran commented 1 month ago

Actually, looking into it slightly more, this is an intentional design of parinfer and, as such won't get fixed. eraserhd/parinfer-rust#106

The link on that issue doesn't work, but I managed to find a working link: https://github.com/parinfer/parinfer.js/blob/master/doc/code.md#dangerous-quotes

I guess I'll be using the \" workaround.