parinfer

henrik 2020-09-20T08:31:18.002100Z

Thanks @mauricio.szabo, I think it’s a no-go though. It doesn’t seem like you can make changes to a TextEditor in response to changes to the same TextEditor.

It is a programming error to invoke [edit] from within a text change callback (such as one registered using onDidChange()). Attempting to do so will throw an Error.

henrik 2020-09-20T08:38:43.003300Z

Ideally, I guess there would be a onWillChange listener so that it would be possible to hijack an edit mid-flight and modify it before it lands on the undo stack.

henrik 2020-09-20T08:42:36.004600Z

But on the other hand I’ve discovered parinfer-plus, and it does seem like it handles itself better than parinfer in Atom! I’m particularly noticing fewer surprises when copying and pasting.