pulsar/packages/autosave
2023-03-12 14:30:15 -07:00
..
lib Bundle autosave 2023-03-11 20:52:36 -08:00
spec Bundle autosave 2023-03-11 20:52:36 -08:00
.gitignore Bundle autosave 2023-03-11 20:52:36 -08:00
LICENSE.md Bundle autosave 2023-03-11 20:52:36 -08:00
package-lock.json Bundle autosave 2023-03-11 20:52:36 -08:00
package.json Install autosave from file. Update README.md and package.json 2023-03-12 14:30:15 -07:00
README.md Bundle autosave 2023-03-11 20:52:36 -08:00

Autosave package

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 by checking Enabled in the settings for the autosave package in the Settings view.

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')
}