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).
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.
@eraserhd tell me, tell me 😛
about the vim events, or about the tabular code?
the vim events 🙂
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.
It runs on all the events we need, and doesn't need to figure out what's happening: CursorMoved, TextChangedI, InsertEnter, etc.
Interesting. Does this mean that it works better?
Fixing c
broke some stuff, including >>
, doing this made everything I know about work again. Even J
seems to do the right thing now.
weirdly.
So, I'm going to say yes. I could use more test coverage though 😄
I looked forward to running :PlugUpdate!