parinfer

cfleming 2017-08-17T01:48:03.000019Z

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

shaunlebron 2017-08-17T03:14:41.000109Z

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

shaunlebron 2017-08-17T03:15:13.000022Z

i think some people expected “stickiness” behavior when dedenting

shaunlebron 2017-08-17T03:16:39.000065Z

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

shaunlebron 2017-08-17T03:17:32.000042Z

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

cfleming 2017-08-17T03:17:45.000122Z

Oh right, I remember now.

shaunlebron 2017-08-17T03:18:18.000095Z

right, replacing println with foo without stickiness would allow:

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

shaunlebron 2017-08-17T03:18:45.000040Z

whereas stickiness would align bar with the map

cfleming 2017-08-17T03:18:58.000090Z

So releaseCursorHold releases the stickiness when the caret moves?

cfleming 2017-08-17T03:19:18.000039Z

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

shaunlebron 2017-08-17T03:19:24.000125Z

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

shaunlebron 2017-08-17T03:20:04.000039Z

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

shaunlebron 2017-08-17T03:20:25.000049Z

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

shaunlebron 2017-08-17T03:21:15.000174Z

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

shaunlebron 2017-08-17T03:21:41.000003Z

if you want all the hairy details: https://github.com/shaunlebron/parinfer/issues/143

cfleming 2017-08-17T03:22:43.000023Z

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

cfleming 2017-08-17T03:22:56.000115Z

Thanks.

cfleming 2017-08-17T03:23:21.000016Z

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

cfleming 2017-08-17T03:23:29.000004Z

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