parinfer

eraserhd 2018-04-02T17:31:17.000405Z

So, I managed to figure out what to do from Vim's state, meaning that I can use the same event handler on the several weird Vim events we need to handle, and it Just Works (tm).

eraserhd 2018-04-02T17:32:19.000611Z

Also, I wonder if @shaunlebron has thought about smart mode and tabular arrangement of code... e.g. case and cond when the conditions are simple.

dominicm 2018-04-02T17:49:24.000199Z

@eraserhd tell me, tell me 😛

eraserhd 2018-04-02T18:27:20.000082Z

about the vim events, or about the tabular code?

dominicm 2018-04-02T18:38:44.000366Z

the vim events 🙂

eraserhd 2018-04-02T18:42:16.000135Z

Vim has b:changedtick, which seems to be monotonically increasing every time the buffer changes. So, my only event handler checks if we've seen this tick, if not runs parinfer, updates buffer and cursor pos, etc. Then stores the cursor position for next time.

eraserhd 2018-04-02T18:43:08.000027Z

It runs on all the events we need, and doesn't need to figure out what's happening: CursorMoved, TextChangedI, InsertEnter, etc.

dominicm 2018-04-02T18:44:30.000684Z

Interesting. Does this mean that it works better?

eraserhd 2018-04-02T18:47:24.000582Z

Fixing c broke some stuff, including >>, doing this made everything I know about work again. Even J seems to do the right thing now.

eraserhd 2018-04-02T18:47:29.000714Z

weirdly.

eraserhd 2018-04-02T18:47:57.000219Z

So, I'm going to say yes. I could use more test coverage though 😄

dominicm 2018-04-02T18:58:26.000090Z

I looked forward to running :PlugUpdate!