Created
November 7, 2018 14:26
-
-
Save hugueschabot/2eab5cda8568914d24de58b462fded6e to your computer and use it in GitHub Desktop.
Atom init script to automatically align table cells on Gherkin files before saving
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
editorWillSaveHandler = null | |
atom.workspace.observeActiveTextEditor (editor) -> | |
if (editorWillSaveHandler) | |
editorWillSaveHandler.dispose() | |
editorWillSaveHandler = null | |
if (editor) | |
if editor.getGrammar().name == "Gherkin" | |
editorWillSaveHandler = editor.getBuffer().onWillSave (event) -> | |
atom.commands.dispatch atom.views.getView(editor), "cucumber:align-table-cells" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment