@shaunlebron Is there some discussion in parinfer issues about smart mode dropping to paren mode that I could look at? I’m particularly interested in releaseCursorHold
.
@cfleming yeah, this was the whole issue around dedenting in smart mode
i think some people expected “stickiness” behavior when dedenting
(println {:a 1
:b 2}
bar)
deleting println should not cause bar
to be absorbed into the map since the user could be typing something else
Oh right, I remember now.
right, replacing println with foo without stickiness would allow:
(foo {:a 1
:b 2}
bar)
whereas stickiness would align bar with the map
So releaseCursorHold releases the stickiness when the caret moves?
i.e. the user perhaps deletes println
and then moves away without adding foo
?
the stickiness is an alternate solution that I didn’t go with
stickiness means bar
would be immediately dedented the moment the map reaches it
and would “stick” to it afterwards when foo
pushes it forward
but what you’re saying is right, if println
is deleted, bar
is dedented if cursor moves away without adding foo
if you want all the hairy details: https://github.com/shaunlebron/parinfer/issues/143
Right, I see how that works. And that’s because paren mode is run on releaseCursorHold.
Thanks.
I think I have a really good solution to my problems, which I’m just starting to integrate and test now.
I’ll report back in the next couple of days.