Autosaves buffers when they lose focus
CoffeeScript
Latest commit d608aa7 Dec 26, 2016 @lee-dohm lee-dohm committed on GitHub Merge pull request #75 from atom/template-update
📝 Update issue and PR templates

README.md

Autosave package

OS X Build Status Windows Build Status Dependency Status

Autosaves editor when they lose focus, are destroyed, or when the window is closed.

This package is disabled by default and can be enabled via the autosave.enabled config setting or from the Autosave section of the Settings view (OS X: cmd-,, Windows & Linux: Ctrl-,).

Service API

The service exposes an object with a function dontSaveIf, which accepts a callback. Callbacks will be invoked with each pane item eligible for an autosave and if the callback returns true, the item will be skipped.

Usage

package.json

"consumedServices": {
  "autosave": {
    "versions": {
      "1.0.0": "consumeAutosave"
    }
  }
}

package initialize

consumeAutosave({dontSaveIf}) {
  dontSaveIf(paneItem -> paneItem.getPath() === '/dont/autosave/me.coffee')
}