Fork me on GitHub
#parinfer
<
2020-09-20
>
henrik08:09:18

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.

henrik08:09:43

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.

henrik08:09:36

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.