Fork me on GitHub
#parinfer
<
2018-04-02
>
eraserhd17:04:17

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).

eraserhd17:04:19

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.

dominicm17:04:24

@eraserhd tell me, tell me 😛

eraserhd18:04:20

about the vim events, or about the tabular code?

dominicm18:04:44

the vim events 🙂

eraserhd18:04:16

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.

eraserhd18:04:08

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

dominicm18:04:30

Interesting. Does this mean that it works better?

eraserhd18:04:24

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

eraserhd18:04:57

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

dominicm18:04:26

I looked forward to running :PlugUpdate!