parinfer

eraserhd 2018-04-18T12:45:08.000583Z

Wait, paste will work if I just turn on force balance?

👀 1
eraserhd 2018-04-18T12:45:28.000402Z

Or "kinda work"?

dominicm 2018-04-18T13:02:00.000362Z

I just tried it in the online demo, force balance didn't fix my pasting woes

dominicm 2018-04-18T13:02:12.000674Z

https://shaunlebron.github.io/parinfer/demo.html that is

dominicm 2018-04-18T13:03:28.000664Z

@eraserhd have you tried doing something like if &paste then paren_mode else smart_mode for vim?

eraserhd 2018-04-18T13:51:09.000626Z

ah. I have not. That's interesting.

eraserhd 2018-04-18T13:51:58.000024Z

I mean, that only works for pasting into the terminal, and it assumes you are pasting something already balanced.

eraserhd 2018-04-18T13:52:02.000330Z

Is that a good assumption?

dominicm 2018-04-18T13:54:33.000030Z

better than the current situation of messing up the balance when pasting?

eraserhd 2018-04-18T13:58:39.000688Z

Well, paren mode will fail if it's not balanced.

eraserhd 2018-04-18T13:59:19.000524Z

I wonder if this is what partialResult is for.

eraserhd 2018-04-18T14:00:27.000201Z

Oh, wait. Pasting into the terminal will be receiving 1000 edits. That probably won't work.

dominicm 2018-04-18T14:02:58.000945Z

could you batch while someone is in paste? :thinking_face:

dominicm 2018-04-18T14:03:44.000271Z

like, first message in paste = cursor start position, and when you're finally in &nopaste, then you send the whole set of changes. Getting a bit complicated now though.

eraserhd 2018-04-18T14:21:48.000608Z

Hmm. Well, I think disabling while in paste is a good start. I think that's what it's for. It might be doable and nice to run paren mode on the first event after paste is disabled. Or add a command to run it manually?

eraserhd 2018-04-18T15:20:21.000892Z

It seems force_balance doesn't work the same on the rust port. I shall fix.

eraserhd 2018-04-18T15:28:48.000371Z

>>> Hey! If anyone wants to write the online documentation for the parinfer-rust Vim plugin, that's a thing which I would greatly appreciate. <<<

eraserhd 2018-04-18T15:29:11.000494Z

The Vim online documentation, I mean.

snoe 2018-04-18T18:20:22.000613Z

@eraserhd https://hacks.mozilla.org/2018/04/hello-wasm-pack/ might be useful for parinfer-rust?

eraserhd 2018-04-18T18:32:02.000288Z

Interesting

eraserhd 2018-04-18T18:32:31.000462Z

I actually saw today that there is a webassembly to jvm compiler. Don't know much about it.

eraserhd 2018-04-18T18:33:16.000644Z

(wasm-pack article queued for reading)