parinfer

eraserhd 2018-04-03T15:04:15.000388Z

@dave.dixon Are you sure? Same thing happens on parinfer-rust, and that's my understanding of how it operates.

eraserhd 2018-04-03T15:04:51.000215Z

It definitely would be nice if it took the change into account. I wonder how to do that.

sparkofreason 2018-04-03T15:19:07.000598Z

@eraserhd Positive, just sanity-checked now. It's probably why the behavior jumped out at me when switching from atom to cursive.

justinlee 2018-04-03T15:40:09.000388Z

hang on, does cursive even have parinfer smart mode? I don’t see it as an option even

sparkofreason 2018-04-03T15:56:54.000891Z

No. I think the Cursive implementation is "smart mode", but it looks like there are differences.

justinlee 2018-04-03T15:59:26.000248Z

huh. i must have it misconfigured because it doesn’t do the thing where it “pushes” the lines below during insert

sparkofreason 2018-04-03T16:07:05.000032Z

Looks like none of the "paredit" behaviors work in atom, and because of that I'm not in the habit of using those in cursive. That must be the trade-off.

shaunlebron 2018-04-03T16:07:47.000799Z

@lee.justin.m smart mode is only in the early release version

shaunlebron 2018-04-03T16:07:57.000610Z

in cursive i mean

sparkofreason 2018-04-03T16:14:13.000062Z

I see now why it would be difficult to get this "right" without detailed context from the editor about exactly what changed.

shaunlebron 2018-04-03T16:17:16.000740Z

@dave.dixon re: your example from yesterday—this should be used as the base for what behavior is canonical. can you reproduce here? http://shaunlebron.github.io/parinfer/demo

sparkofreason 2018-04-03T16:18:57.000014Z

Yes. I understand why now.

sparkofreason 2018-04-03T16:27:24.000725Z

What is expected in this case: (fn [a] (foo)), delete [, yields (fn a] (foo). Has the barf behavior if the [] are nested.

sparkofreason 2018-04-03T16:28:50.000250Z

And the above is only observed for the single line case.

shaunlebron 2018-04-03T16:29:34.000786Z

you can check the canonical editor again for an exact answer

shaunlebron 2018-04-03T16:29:54.000840Z

but “paredit” behavior is something that I will not be advertising anymore

shaunlebron 2018-04-03T16:30:16.000552Z

i didn’t really understand why it worked initially

shaunlebron 2018-04-03T16:30:26.000092Z

but now i understand why it doesn’t work in these inline cases

shaunlebron 2018-04-03T16:31:20.000229Z

there are two choices that parinfer has to choose from in the case you described

shaunlebron 2018-04-03T16:31:36.000326Z

and it uses forceBalance option to pick one of the two

shaunlebron 2018-04-03T16:31:52.000108Z

you can play with that option in the demo editor too

shaunlebron 2018-04-03T16:33:36.000711Z

forcebalance on is super aggressive and will likely restructure your code in unwanted ways. forcebalance off trusts that you can fix the inline imbalances yourself

sparkofreason 2018-04-03T16:34:09.000356Z

Got it. Thanks.

eraserhd 2018-04-03T17:44:10.000598Z

Just got bit by a %s/short-name/much-longer-name/ in a file breaking indent.

eraserhd 2018-04-03T20:26:23.000072Z

I think that's pretty much impossible with Vim. But I still want it 🙂

cfleming 2018-04-03T20:33:42.000163Z

@shaunlebron Any idea why Atom isn’t exhibiting the canonical behaviour in @dave.dixon’s case?

shaunlebron 2018-04-03T20:42:58.000476Z

@cfleming @dave.dixon can’t reproduce, i’d record a gif, but i’m screen recording a meeting right now

eraserhd 2018-04-03T20:45:35.000741Z

hmm, /me has just realized that (x| y\n z), typing something doesn't push z to the right.

shaunlebron 2018-04-03T20:46:05.000413Z

@eraserhd yeah the search/replace is a prime example of why all changes need to be passed to the parinfer’s changes option

eraserhd 2018-04-03T20:46:19.000177Z

Oh... if I did that, it would work?

shaunlebron 2018-04-03T20:46:47.000527Z

yeah, i have pages of these kinds of test cases that we are covering with the changes options

eraserhd 2018-04-03T20:47:20.000604Z

ahhh. Hmm. I wonder if that's possible in Vim.