ccw-ide / ccw

Counterclockwise is an Eclipse plugin helping developers write Clojure code
https://github.com/laurentpetit/ccw/wiki/GoogleCodeHome
Eclipse Public License 1.0
220 stars 50 forks source link

Slurp breaks structure if quoted. #865

Open gilch opened 8 years ago

gilch commented 8 years ago

Example:

; '|' is cursor
(1 2 3 '[|] 4 5 6)
; C-0 s
(1 2 3 '[| 4 5 6)

The [ isn't balanced. This is no longer valid structure. What probably should have happened:

(1 2 3 '[| 4] 5 6)

The syntax-quote ``` has the same effect.

Backwards slurp also has problems. It breaks structure in some cases:

; back slurp a set literal
(1 2 3 #{|} 4 5 6)
; C-9 s
(1 2 #{3 |{} 4 5 6)

This is no longer valid structure. There's an extra {. What probably should have happened:

(1 2 #{3 |} 4 5 6)

Backwards slurping a quoted form simply deletes the quote.

(1 2 3 '[|] 4 5 6)
; C-9 s
(1 2 3 [|] 4 5 6)

What probably should have happened:

(1 2 '[3 |] 4 5 6)
laurentpetit commented 8 years ago

@thickey do you feel like you could take a look at it?