Skip to content

Instantly share code, notes, and snippets.

@aminroosta
Created January 9, 2016 23:20
Show Gist options
  • Save aminroosta/368bb4e3f3987b2dcad1 to your computer and use it in GitHub Desktop.
Save aminroosta/368bb4e3f3987b2dcad1 to your computer and use it in GitHub Desktop.
atom init.coffee file to add toggle fold support
atom.commands.add 'atom-text-editor',
'editor:toggle-folding': (event) ->
editor = @getModel()
bufferRow = editor.bufferPositionForScreenPosition(editor.getCursorScreenPosition()).row
if editor.isFoldedAtBufferRow(bufferRow)
editor.unfoldBufferRow(bufferRow)
else
editor.foldBufferRow(bufferRow)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment