Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hugueschabot/2eab5cda8568914d24de58b462fded6e to your computer and use it in GitHub Desktop.
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
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