I’m trying to trigger some find-replace actions right before saving files, in vain. Here is what I’ve got so far in the init script:
atom.workspace.observeTextEditors (editor) -> editor.getBuffer().onWillSave -> editor.getBuffer().replace("foo", "bar")
This is the first time I’m hacking Atom so I guess I’m missing something obvious, could you please tell me what’s wrong ?
Thank you for your help.