parinfer

shaunlebron 2017-07-08T00:34:49.610252Z

made some good progress toward a unified mode this week. thanks @rgdelato for the nice example behaviors!

shaunlebron 2017-07-08T00:34:56.611103Z

first look: https://www.youtube.com/watch?v=9iZfdfsoC5o

đź‘Ź 2
🎉 1
cfleming 2017-07-08T07:33:49.330318Z

@shaunlebron That looks awesome!

tianshu 2017-07-08T07:59:56.418956Z

looks awesome

tianshu 2017-07-08T08:00:37.423429Z

so Is it the time to make parinfer v2 for each editor?

shaunlebron 2017-07-08T16:31:38.475717Z

@doglooksgood would be nice for v2 to get beta-tested in each editor. there’s been a lot of changes that we have to port over to the non-js implementations, which I can help with

sekao 2017-07-08T16:48:08.560116Z

this is fantastic, shaun. it has one big advantage over my hack, which is that you can surround a multiline form with delimiters and it adjusts the indentation. mine adjusts indentation based on tools.reader data (before running parinfer), which isn't available when the form is temporarily broken.

shaunlebron 2017-07-08T16:49:16.565642Z

ah! I didn’t realize this solved that caveat

shaunlebron 2017-07-08T16:52:17.581156Z

this may not mean anything to anyone, but this was basically a one-line change to subtract the indentDelta when finding open-parens to pop off the stack: https://github.com/shaunlebron/parinfer/blob/master/lib/parinfer.js#L599

shaunlebron 2017-07-08T16:53:14.586141Z

wish I could explain better, but it’s funny how that eluded me for so long

shaunlebron 2017-07-08T16:53:38.588248Z

@sekao: is cursorDx easy to compute in your night editors?

sekao 2017-07-08T16:55:35.598268Z

yeah is that just a delta of the cursor position before/after each change?

shaunlebron 2017-07-08T16:55:42.598823Z

yes

sekao 2017-07-08T16:57:53.610173Z

cool that should be easy. getting the absolute position from the top of the file is slow, but i think i can get away with computing it relative to the nearest form. gotta look into that