parinfer

eraserhd 2018-03-30T15:34:34.000134Z

pushed a fix for c

eraserhd 2018-03-30T17:07:33.000395Z

thought: typing semicolon while pushing a lot of closing parens should remove the paren trail from the new comment.

eraserhd 2018-03-30T17:07:58.000290Z

also, I accidentally hit ; a lot

shaunlebron 2018-03-30T17:11:15.000433Z

is there no vim “change” event to subscribe to?

shaunlebron 2018-03-30T17:11:44.000084Z

ideally, if the buffer changed, there would be an event that described the nature of the change for any operation

shaunlebron 2018-03-30T17:13:21.000524Z

I’ve only personally integrated smart mode for Atom and CodeMirror so far. both had the “change” event I described

justinlee 2018-03-30T17:29:12.000481Z

@eraserhd hah i thought i was the only one. which is too bad because hitting semicolon with parinfer accidentally really causes pandemonium sometimes!

eraserhd 2018-03-30T17:30:50.000400Z

@shaunlebron Vim events are very weird. They don't carry a lot of information, like the previous cursor. So I need to find events that get triggered before each thing.

eraserhd 2018-03-30T17:31:47.000110Z

(as well as after). I'm now tracking CursorMove, which helps in some cases and hurts in others.

eraserhd 2018-03-30T17:32:28.000157Z

There's also weirdness where some commands which enter "insert mode" make changes in the process, and those changes don't emit a "TextChanged*" event.

shaunlebron 2018-03-30T17:33:16.000151Z

😕 bummer

eraserhd 2018-03-30T17:33:32.000142Z

So sometimes I need to call parinfer on InsertEnter (e.g. a "change" command), and sometimes I need to store the cursor position for the next change. 🙂

eraserhd 2018-03-30T17:34:35.000069Z

Well, it's going to be annoying case-by-case work, but I have a decent test rig now, so it'll get better.