@dave.dixon Are you sure? Same thing happens on parinfer-rust
, and that's my understanding of how it operates.
It definitely would be nice if it took the change into account. I wonder how to do that.
@eraserhd Positive, just sanity-checked now. It's probably why the behavior jumped out at me when switching from atom to cursive.
hang on, does cursive even have parinfer smart mode? I don’t see it as an option even
No. I think the Cursive implementation is "smart mode", but it looks like there are differences.
huh. i must have it misconfigured because it doesn’t do the thing where it “pushes” the lines below during insert
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.
@lee.justin.m smart mode is only in the early release version
in cursive i mean
I see now why it would be difficult to get this "right" without detailed context from the editor about exactly what changed.
@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
Yes. I understand why now.
What is expected in this case: (fn [a] (foo))
, delete [
, yields (fn a] (foo)
. Has the barf behavior if the []
are nested.
And the above is only observed for the single line case.
you can check the canonical editor again for an exact answer
but “paredit” behavior is something that I will not be advertising anymore
i didn’t really understand why it worked initially
but now i understand why it doesn’t work in these inline cases
there are two choices that parinfer has to choose from in the case you described
and it uses forceBalance
option to pick one of the two
you can play with that option in the demo editor too
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
Got it. Thanks.
Just got bit by a %s/short-name/much-longer-name/ in a file breaking indent.
I think that's pretty much impossible with Vim. But I still want it 🙂
@shaunlebron Any idea why Atom isn’t exhibiting the canonical behaviour in @dave.dixon’s case?
@cfleming @dave.dixon can’t reproduce, i’d record a gif, but i’m screen recording a meeting right now
hmm, /me has just realized that (x| y\n z)
, typing something doesn't push z
to the right.
@eraserhd yeah the search/replace is a prime example of why all changes need to be passed to the parinfer’s changes option
Oh... if I did that, it would work?
yeah, i have pages of these kinds of test cases that we are covering with the changes
options
ahhh. Hmm. I wonder if that's possible in Vim.