Fork me on GitHub
#parinfer
<
2017-08-17
>
cfleming01:08:03

@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.

shaunlebron03:08:41

@cfleming yeah, this was the whole issue around dedenting in smart mode

shaunlebron03:08:13

i think some people expected “stickiness” behavior when dedenting

shaunlebron03:08:39

(println {:a 1
          :b 2}
  bar)

shaunlebron03:08:32

deleting println should not cause bar to be absorbed into the map since the user could be typing something else

cfleming03:08:45

Oh right, I remember now.

shaunlebron03:08:18

right, replacing println with foo without stickiness would allow:

(foo {:a 1
      :b 2}
  bar)

shaunlebron03:08:45

whereas stickiness would align bar with the map

cfleming03:08:58

So releaseCursorHold releases the stickiness when the caret moves?

cfleming03:08:18

i.e. the user perhaps deletes println and then moves away without adding foo?

shaunlebron03:08:24

the stickiness is an alternate solution that I didn’t go with

shaunlebron03:08:04

stickiness means bar would be immediately dedented the moment the map reaches it

shaunlebron03:08:25

and would “stick” to it afterwards when foo pushes it forward

shaunlebron03:08:15

but what you’re saying is right, if println is deleted, bar is dedented if cursor moves away without adding foo

cfleming03:08:43

Right, I see how that works. And that’s because paren mode is run on releaseCursorHold.

cfleming03:08:21

I think I have a really good solution to my problems, which I’m just starting to integrate and test now.

cfleming03:08:29

I’ll report back in the next couple of days.