Giter VIP home page Giter VIP logo

autosave's Introduction

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

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

autosave's People

Contributors

50wliu avatar akonwi avatar as-cii avatar balexand avatar benatkin avatar damieng avatar darangi avatar jasonrudolph avatar kevinsawicki avatar lee-dohm avatar maxbrunsfeld avatar mnquintana avatar peterdavehello avatar smashwilson avatar tylerburnett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autosave's Issues

save even if nothing changes

it always saves when the focus is out or the pane is closed, even if nothing has changed. Could it detect that file is really changed and skip save if nothing has changed?
It triggers monitoring tools (I'm using rspec) when I just look through files without editing.

Failed to activate the autosave package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.2
System: Mac OS X 10.10.3
Thrown From: autosave package, v0.22.0

Stack Trace

Failed to activate the autosave package

At undefined is not a function

TypeError: undefined is not a function
  at Object.module.exports.activate (/Users/yuzongzhao/.atom/packages/autosave/lib/autosave.coffee:7:7)
  at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:240:19)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:221:30
  at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:165:15)
  at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:213:14)
  at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:452:21)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:313:19
  at /Applications/Atom.app/Contents/Resources/app.asar/src/config.js:574:20
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at Config.module.exports.Config.emitChangeEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:736:29)
  at Config.module.exports.Config.setRawValue (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:551:19)
  at Config.module.exports.Config.set (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:233:14)
  at Config.module.exports.Config.removeAtKeyPath (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:343:12)
  at Package.module.exports.Package.enable (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:150:26)
  at PackageManager.module.exports.PackageManager.enablePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:142:14)
  at HTMLButtonElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-card.js:314:27)
  at HTMLButtonElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
  at HTMLButtonElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -1:11.9.0 settings-view:open (atom-text-editor.editor.is-focused)
     -0:19.3.0 editor:add-selection-above (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ]
  }
}

Installed Packages

# User
autosave, v0.22.0
monokai, v0.7.0

# Dev
No dev packages

Time Delay

I've had problems with the autosave functionality when changing workspace in Ubuntu.
Some times it just didn't worked.

I was able to find that if I did the workspace change slowly, the save was performed, but if I did it
real fast (as I commonly do), the save was not performed.

I come from Brackets and whatever the speed I did the workspace change, it always saved the changes
in the editor, so I suppose it may be related with some time delay expected or something like that.

I hope this is not too dumb, greetings.

/* Using: Ubuntu 14.04.2, Atom 0.204.0, Autosave 0.20.0 */

Moving cursor with mouse triggers an autosave with the React Editor

I have some tests that get run on file saves. I noticed after switching to the React Editor, the tests were being run repeatedly even though I was still working in the same file.

It looks like autosave is now saving after making a change and then clicking elsewhere in the same file. Focus is not lost, just the cursor position changes. Moving the cursor with arrow keys does not trigger an autosave.

Autosave triggers on every keystroke

...which is unfortunate because I have my config setup to automatically compile + restart a local server every time a file is saved. That's a lot of work for every keystroke ...also a lot of compilation errors :)

Uncaught Error: Can't create a backup file for /usr/local/texlive/2015/texmf-dist/tex/latex/xcolo...

[Enter steps to reproduce below:]

  1. Edit a file that is write protected file
  2. Try to save it under another filename.
  3. When the current window loses focus the Autosave kicks in
  4. Press cancel on the password dialog (which in (this case luckily) doesn't autofocus)
  5. Keep on pressing cancel while trying to extract the content ctr+a, ctr+c

And poof, there it goes. Will work everytime. It isn't really the fault of the autosave package. It is Atom itself that is not capable of dealing with write protected files. You can't save them elsewhere even when no autosave is being used it won't let you choose another destination.
Why it brings up the password dialog in the first place is beyond me anyway. Even if I enter my sudo capable password it will not be able to edit a file of the type that has the write privs at 0 (like 600, 700, 400 whatever). It would propably need a privileged helper tool for that.
System: Mac OS X 10.10.5
Thrown From: autosave package, v0.22.0

Stack Trace

Uncaught Error: Can't create a backup file for /usr/local/texlive/2015/texmf-dist/tex/latex/xcolor-solarized/xcolor-solarized.sty because files already exist at every candidate path.

At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:809

Error: Can't create a backup file for /usr/local/texlive/2015/texmf-dist/tex/latex/xcolor-solarized/xcolor-solarized.sty because files already exist at every candidate path.
  at TextBuffer.module.exports.TextBuffer.backUpFileContentsBeforeWriting (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1097:17)
  at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1020:31)
  at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1004:19)
  at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:584:26)
  at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:547:18)
  at Object.module.exports.autosavePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:64:21)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:41:24
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at PaneContainer.module.exports.PaneContainer.willDestroyPaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-container.js:280:27)
  at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:459:17)
  at HTMLDivElement.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/tabs/lib/tab-bar-view.js:236:22)
  at space-pen-ul.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
  at space-pen-ul.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)
  at EventEmitter.ipc.sendSync (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/ipc.js:21:31)
  at BrowserWindow.RemoteMemberFunction [as getPosition] (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/remote.js:140:29)
  at Atom.module.exports.Atom.getWindowDimensions (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:555:29)
  at Atom.module.exports.Atom.storeDefaultWindowDimensions (/Applications/Atom.app/Contents/Resources/app.asar/src/atom.js:588:25)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:104:21
  at handler (/Applications/Atom.app/Contents/Resources/app.asar/src/space-pen-extensions.js:115:32)
  at jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/space-pen/vendor/jquery.js:4681:9)
  at elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/space-pen/vendor/jquery.js:4359:46)

Commands

  3x -2:43.3.0 core:backspace (atom-text-editor.editor.is-focused)
     -2:42.1.0 core:delete (atom-text-editor.editor.is-focused)
     -2:40.6.0 core:move-down (atom-text-editor.editor.is-focused)
     -2:40 core:move-right (atom-text-editor.editor.is-focused)
     -2:39.5.0 core:move-down (atom-text-editor.editor.is-focused)
  2x -2:39.2.0 core:move-right (atom-text-editor.editor.is-focused)
     -2:38.2.0 core:delete (atom-text-editor.editor.is-focused)
     -2:37.8.0 core:move-down (atom-text-editor.editor.is-focused)
     -2:36.6.0 core:delete (atom-text-editor.editor.is-focused)
  2x -2:36.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -2:35.2.0 core:move-down (atom-text-editor.editor.is-focused)
  3x -2:34.4.0 core:delete (atom-text-editor.editor.is-focused)
     -2:32.1.0 core:move-down (atom-text-editor.editor.is-focused)
     -2:31.6.0 core:move-right (atom-text-editor.editor.is-focused)
  2x -2:31 core:delete (atom-text-editor.editor.is-focused)
  6x -2:10.7.0 core:copy (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "about",
      "language-go",
      "language-git",
      "language-java",
      "language-javascript",
      "language-less",
      "language-mustache",
      "language-php",
      "language-sass",
      "language-yaml",
      "language-todo",
      "metrics",
      "release-notes",
      "link",
      "preview-inline",
      "language-css",
      "language-csharp",
      "language-coffee-script",
      "language-clojure",
      "language-c",
      "language-sql"
    ],
    "packagesWithKeymapsDisabled": [
      "latex-plus",
      "linter"
    ],
    "themes": [
      "one-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  },
  "autosave": {
    "enabled": true
  }
}

Installed Packages

# User
atom-beautify, v0.28.14
autocomplete-bibtex, v0.6.1
bottom-dock, v0.3.5
file-watcher, v0.4.0
highlight-selected, v0.10.1
language-latex, v0.6.1
language-lua, v0.9.4
latex, v0.26.0
latex-completions, v0.3.0
latexer, v0.2.7
linter, v1.8.1
linter-chktex, v1.1.3
linter-manager, v0.2.3
markdown-preview-plus, v2.2.2
minimap, v4.13.4
minimap-highlight-selected, v4.3.1
pretty-json, v0.4.1

# Dev
No dev packages

Uncaught Error: EACCES, permission denied '/etc/apt/sources.list.d/pgdg.list'

Uncaught Error: EACCES, permission denied '/etc/apt/sources.list.d/pgdg.list'

Atom Version: 0.158.0
System: linux 3.13.0-44-generic
Thrown From: autosave package, v0.19.0

Steps To Reproduce

  1. ...
  2. ...

Stack Trace

At /usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:311

Error: EACCES, permission denied '/etc/apt/sources.list.d/pgdg.list'
  at Error (native)
  at Object.fs.openSync (fs.js:455:18)
  at Object.module.(anonymous function) [as openSync] (/usr/share/atom/resources/atom/common/lib/asar.js:422:20)
  at Object.fs.writeFileSync (fs.js:1011:15)
  at Object.fsPlus.writeFileSync (/usr/share/atom/resources/app/node_modules/fs-plus/lib/fs-plus.js:228:17)
  at File.module.exports.File.writeFileSync (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:227:19)
  at File.module.exports.File.writeFileWithPrivilegeEscalationSync (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:297:21)
  at File.module.exports.File.write (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:286:12)
  at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:966:17)
  at TextBuffer.module.exports.TextBuffer.save (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:954:19)
  at TextEditor.module.exports.TextEditor.save (/usr/share/atom/resources/app/src/text-editor.js:585:26)
  at Object.module.exports.autosavePaneItem (/usr/share/atom/resources/app/node_modules/autosave/lib/autosave.js:56:80)
  at /usr/share/atom/resources/app/node_modules/autosave/lib/autosave.js:27:26
  at HTMLInputElement.<anonymous> (/usr/share/atom/resources/app/src/text-editor-element.js:178:26)

/cc @atom/core

autosave auto moves cursor to top of the file

Atom version: 1.4.0
System: arch linux

Issue

  • Open 2 files in atom
  • Scroll to the middle of the 1st file
  • Click 2nd tab and make a change to the 2nd file
  • Click 1st tab: cursor has moved to the top of the file

Autosave not saving new files

If I start editing a new (non-existant) file, make some changes, and close atom, the file is not saved.

to reproduce:

$ atom newfile
 (add some text to newfile)
 (press cmd-q to quit atom)
$ ls newfile
 (notice newfile has not been created)

Not working as expected

My expectations come from using other ide's.

  1. Doesn't save when focus is lost.

    I'm working on a javascript file. I expect that when I switch to an html doc and open it in html preview, that the changes to my
    javascript file would be saved and show up in the preview. This doesn't happen. If I check in file explorer, the file size and timestamp is not updated.

  2. Prompts to save when closing window.

    This is really anoying, I've never seen autosave implemented this way. I expect that it would save silently with no prompt. As it is, it's easier just to use ctrl-s instead of this plugin. I've actually uninstalled it for this reason.

My autosave no longer works

Yesterday while coding I accidentally hit some combination of keys, which quitted me out of Atom and then when I reopened it autosave no longer worked. I have to know manually hit command-s every time I want to save something.

I downloaded another autosave package but it still won't work. Do you know why the original autosave will no longer work for me?

autosaving deleted, moved, renamed files

Bug: any open file that gets renamed or deleted will be ressurected by autosave.

This is a usability nightmare. Often results in editing the wrong file, or files that should have been deleted not getting deleted.

Uncaught Error: EPERM: operation not permitted, open 'C:\Users\jysperm\Git\jysperm\RootPanel\.gitignore'

  1. Edit .gitignore in my project.
  2. Use ctrl-S to save the file, then it throw this error.

Restart Atom can't solve the problem. The same problem also appear in another project.

Only .gitignore will throw error, other dot files(.npmignore) are not.

Atom Version: 0.201.0
System: Windows 10
Thrown From: autosave package, v0.20.0

Stack Trace

Uncaught Error: EPERM: operation not permitted, open 'C:\Users\jysperm\Git\jysperm\RootPanel.gitignore'

At C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\pathwatcher\lib\file.js:376

Error: EPERM: operation not permitted, open 'C:\Users\jysperm\Git\jysperm\RootPanel\.gitignore'
  at Error (native)
  at Object.fs.openSync (fs.js:544:18)
  at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:118:20)
  at Object.fs.writeFileSync (fs.js:1155:15)
  at Object.fsPlus.writeFileSync (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\fs-plus\lib\fs-plus.js:279:17)
  at File.module.exports.File.writeFileSync (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\pathwatcher\lib\file.js:264:19)
  at File.module.exports.File.writeFileWithPrivilegeEscalationSync (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\pathwatcher\lib\file.js:362:21)
  at File.module.exports.File.writeSync (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\pathwatcher\lib\file.js:336:12)
  at TextBuffer.module.exports.TextBuffer.saveAs (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:981:17)
  at TextBuffer.module.exports.TextBuffer.save (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:967:19)
  at TextEditor.module.exports.TextEditor.save (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\src\text-editor.js:567:26)
  at Object.module.exports.autosavePaneItem (C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\autosave\lib\autosave.js:56:80)
  at C:\Users\jysperm\AppData\Local\atom\app-0.201.0\resources\app.asar\node_modules\autosave\lib\autosave.js:27:26

Commands

     -0:06.0 core:paste (atom-text-editor.editor.is-focused)
     -0:04.2.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "projectHome": "C:\\Users\\jysperm\\Git",
    "disabledPackages": [
      "react"
    ]
  },
  "autosave": {
    "enabled": true
  }
}

Installed Packages

# User
atom-beautify, v0.27.6
atom-ternjs, v0.6.2
file-icons, v1.5.5
git-projects, v1.14.1
language-jade, v0.4.0
linter, v0.12.6
linter-coffeelint, v0.2.4
remote-sync, v3.1.1
wakatime, v4.0.9

# Dev
No dev packages

Package is shown as enabled in atom, but files are not autosaving when they lose focus

I have a pretty basic project, just making minor changes to package.json/bower.json and a few js files, but none of the changes are saving without my explicit save attempt.

I'm used to Webstorm, where files just save as I make changes, even without losing focus....but at least having basic autosave functionality here would be nice.

Atom v0.141.0 on Windows 7 Pro

Auto Save not working,

I've had a million headaches trying to figure out why my code wasn't working or even changing.. all the while it's because my changes weren't getting saved. Please fix? :)

Autosave is enabled but I'm still prompted to save when closing

I enabled the autosave plugin via CMD+, but each time I quit or close a tab, Atom prompts me to save the file.

I expected this plugin to enable the same functionality from Sublime Text wherein files are automatically saved as-is when I quit. However, enabling / disabling this plugin doesn't seem to have any effect on that workflow.

Is this broken or did I misunderstand what this is supposed to do?

Doesn't autosave even though it's enabled

I'm using Atom 0.84.0 and when I install autosave files are, well, not being autosaved. Doesn't matter if I lose focus to a different open file or a different process. I have the line 'autosave': 'enabled'
in my config file.

One other bit that may help: when I type 'autosave' into the filter packages box and pull up its settings, it shows it as enabled. There's a tick box at the bottom however that I check and, upon restart, is no longer checked.

Any ideas? Or additional info I can provide?

Autosave package causes problems when pulling in changes with git

Discovered this one today while collaborating on a branch with some people. Below is a rough outline of the steps to reproduce problem, I'll try to do some more testing later tonight and update if necessary, but the idea of the problem should be clear enough.

  1. UserA checks out a git repo that other people have access to.
  2. UserA opens the project in atom (with autosave enabled) and opens some files.
  3. UserB modifies any of the files UserA has open in atom, commits and pushes changes.
  4. UserA pulls in these changes, there are no conflicts and everything merges nice.
  5. Instead of atom updating those files with the latest modified code autosave fires and saves the "former working version" (essentially the pre-pull HEAD state) over the top of the newly updated file clobbering any recently pulled changes.
  6. UserA is unaware of this, commits and pushes wiping out UserB's changes on the remote repo.

It's possible this is an overarching atom bug, but I suspect it might have something to do with autosave. Like I mentioned, still need to do a little more testing to iron it out, but that's essentially the process I went through a few times today before realizing what was happening. Unless the user runs a full diff before every commit this is hard to notice, since generally the files are open in atom because they're being modified, so seeing them in git status isn't strange.

Good luck!

When is auto-saving happening?

When are files actually auto-saved? Plugin is enabled for my installation but I keep running into occasions where I forget to save and find myself searching a non-existent bug for a few minutes...

(Would really love this to work like Rubymine auto-saving, never had any issues with that)

Enabled by default?

Is there any specific reason for being "disabled by default"?

Also, can the pending PR's #22 and #31 be merged or what?

Uncaught TypeError: Cannot read property 'getGrammar' of undefined

I'm not sure what causes this, it's pretty common but seems to be intermittent

Atom Version: 1.3.2
System: Mac OS X 10.11.1
Thrown From: autosave package, v0.23.0

Stack Trace

Uncaught TypeError: Cannot read property 'getGrammar' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:829

TypeError: Cannot read property 'getGrammar' of undefined
    at Object.module.exports.run (<anonymous>:46:14)
    at <anonymous>:30:12
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:798:18)
    at <anonymous>:28:14
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
    at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1038:20)
    at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1030:19)
    at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:588:26)
    at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:534:18)
    at Object.module.exports.autosavePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:64:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:29:26
    at atom-pane.PaneElement.activeItemChanged (/Applications/Atom.app/Contents/Resources/app.asar/src/pane-element.js:152:25)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:86:11)
    at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:248:22)
    at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:316:21)
    at Pane.module.exports.Pane.activateItemAtIndex (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:310:19)
    at Pane.module.exports.Pane.activateNextItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:267:21)
    at atom-workspace.commandRegistry.add.pane:show-next-item (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:11:48)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

  2x -0:56.7.0 core:select-right (atom-text-editor.editor.is-focused)
  3x -0:52.9.0 editor:move-to-end-of-word (atom-text-editor.editor.is-focused)
     -0:51.7.0 core:move-right (atom-text-editor.editor.is-focused)
  2x -0:51.3.0 core:select-right (atom-text-editor.editor.is-focused)
  2x -0:44.6.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:36.6.0 settings-view:open (atom-text-editor.editor.is-focused)
  2x -0:27.3.0 core:backspace (atom-text-editor.editor.mini.is-focused)
  2x -0:20.2.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:19.7.0 core:undo (atom-text-editor.editor.is-focused)
     -0:17.7.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:17.5.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:16.6.0 core:select-left (atom-text-editor.editor.is-focused)
  2x -0:16.3.0 core:copy (atom-text-editor.editor.is-focused)
     -0:13.2.0 find-and-replace:show (atom-text-editor.editor.is-focused)
  2x -0:11.4.0 core:undo (atom-text-editor.editor.mini.is-focused)
     -0:01.0 pane:show-next-item (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "ignoredNames": [
      ".git",
      ".svn",
      ".DS_Store"
    ],
    "disabledPackages": [
      "markdown-writer"
    ]
  },
  "autosave": {
    "enabled": true
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.3.0
linter-write-good, v0.6.1
markdown-deluxe, v1.0.0
markdown-scroll-sync, v2.0.3
tidy-markdown, v1.0.0

# Dev
No dev packages

Uncaught Error: dlopen(/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar.unpacked/node...

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.4
System: Mac OS X 10.10.5
Thrown From: autosave package, v0.23.0

Stack Trace

Uncaught Error: dlopen(/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar.unpacked/node_modules/runas/build/Release/runas.node, 1): image not found

At /Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/src/pane.js:825

Error: dlopen(/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar.unpacked/node_modules/runas/build/Release/runas.node, 1): image not found
    at Error (native)
    at Object.module.(anonymous function) (ATOM_SHELL_ASAR.js:137:20)
    at Object.module.(anonymous function) [as .node] (ATOM_SHELL_ASAR.js:148:18)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/runas/lib/runas.js:4:11)
    at Object.<anonymous> (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/runas/lib/runas.js:47:4)
    at Module._compile (module.js:434:26)
    at Object.defineProperty.value [as .js] (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:190:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at File.module.exports.File.writeFileWithPrivilegeEscalationSync (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:403:21)
    at File.module.exports.File.writeSync (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:355:12)
    at TextBuffer.module.exports.TextBuffer.saveAs (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1021:19)
    at TextBuffer.module.exports.TextBuffer.save (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1002:19)
    at TextEditor.module.exports.TextEditor.save (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/src/text-editor.js:557:26)
    at Pane.module.exports.Pane.saveItem (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/src/pane.js:530:18)
    at Object.module.exports.autosavePaneItem (/Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:64:21)
    at /Users/spawas/Downloads/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:29:26

Commands

     -1:06.4.0 vim-mode:activate-insert-mode (atom-text-editor.editor.vim-mode.is-focused.normal-mode)
     -1:00.1.0 core:backspace (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:57.5.0 core:move-left (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  2x -0:52.8.0 core:undo (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:50.1.0 core:move-right (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  3x -0:49.7.0 core:backspace (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:23.8.0 core:undo (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:16.8.0 window:save-all (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  4x -0:02.2.0 blur (atom-text-editor.editor.vim-mode.is-focused.insert-mode)

Config

{
  "core": {},
  "autosave": {
    "enabled": true
  }
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

Most computers don't have a cmd key

Description says "from the Autosave section of the Settings view (cmd-,)". I don't have a cmd key, because they only exist on Apple laptops. What should be pressed?

auto save make lint's disappear

i'm using auto save for web front end development so set it's time 0.01 for showing fast to me with livereload.
problem comes up when i want to use it with lints, when auto save ( or any save methods) work lint's disappear .
is there any way to solve that problem?

Autosave on all open files (including unsaved/unnamed buffers)

Is it possible to also autosave on unsaved/unnamed buffers?

SublimeText's in-built auto-save has this feature - basically, if your editor dies or crashes, when it comes back up, it will be exactly as you left it, including any unsaved buffers.

I've had Atom crash on me (pre-release software and all) and lost things due to having text in unsaved buffers, even with Auto-Save enabled.

Autosave if Atom is idle

I use JetBrains products and they have an option to "Save files automatically if application is idle for __ sec.".

I would like this package to provide this feature and not require a blur/loss of focus of the Atom window to trigger a save.

Add scope-specific autosave setting

If autosave is enabled in the main config it works in Atom 1.2.0, but if I try to turn autosave on for only one language it does not work. I believe in Atom 1.1.0 it was working. I have the following config.

"source.gfm":
  editor:
    softWrap: true
  autosave:
    enabled: true

Uncaught Error: EACCES, permission denied '/home/wompt/ang2test/quickstart/app.es6'

[Enter steps to reproduce below:]

  1. Open a file without sudo permissions and edit while autosave is running.
  2. ...

Atom Version: 0.187.0
System: linux 3.13.0-37-generic
Thrown From: autosave package, v0.20.0

Stack Trace

Uncaught Error: EACCES, permission denied '/home/wompt/ang2test/quickstart/app.es6'

At /usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:329

Error: EACCES, permission denied '/home/wompt/ang2test/quickstart/app.es6'
  at Error (native)
  at Object.fs.openSync (fs.js:503:18)
  at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:118:20)
  at Object.fs.writeFileSync (fs.js:1116:15)
  at Object.fsPlus.writeFileSync (/usr/share/atom/resources/app/node_modules/fs-plus/lib/fs-plus.js:243:17)
  at File.module.exports.File.writeFileSync (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:245:19)
  at File.module.exports.File.writeFileWithPrivilegeEscalationSync (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:315:21)
  at File.module.exports.File.write (/usr/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:304:12)
  at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:970:17)
  at TextBuffer.module.exports.TextBuffer.save (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:958:19)
  at TextEditor.module.exports.TextEditor.save (/usr/share/atom/resources/app/src/text-editor.js:621:26)
  at Object.module.exports.autosavePaneItem (/usr/share/atom/resources/app/node_modules/autosave/lib/autosave.js:56:80)
  at Object.module.exports.autosaveAllPaneItems (/usr/share/atom/resources/app/node_modules/autosave/lib/autosave.js:64:28)
  at /usr/share/atom/resources/app/node_modules/autosave/lib/autosave.js:25:26

Commands

  2x -5:15.7 editor:newline (atom-text-editor.editor)
     -4:14.7 core:save (atom-workspace.workspace.scrollbars-visible-always.theme-atom-dark-syntax.theme-atom-dark-ui.find-visible)
     -4:00.9 core:paste (atom-text-editor.editor)
     -3:57.8 editor:newline (atom-text-editor.editor)
     -3:52.8 core:copy (atom-text-editor.editor)
     -3:50.0 editor:newline (atom-text-editor.editor)
     -3:49.6 core:move-up (atom-text-editor.editor)
     -3:48.5 core:paste (atom-text-editor.editor)
  2x -1:20.9 editor:newline (atom-text-editor.editor)
     -1:19.3 core:paste (atom-text-editor.editor)
     -1:14.6 editor:newline (atom-text-editor.editor)
     -1:10.4 core:save-as (atom-text-editor.editor)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  },
  "autosave": {
    "enabled": true
  }
}

Installed Packages

# User
linter, v0.12.0
open-in-browser, v0.4.3

# Dev
No dev packages

Code suggestion triggers the save

Im using a plugin to give me autosuggestion after a slight delay, when it happens the save is triggered on the current file, which is not ideal.

Failed to load the autosave package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.6.0
System: Mac OS X 10.10.2
Thrown From: autosave package, v0.23.1

Stack Trace

Failed to load the autosave package

At Cannot find module 'fs-plus'

Error: Cannot find module 'fs-plus'
    at Module._resolveFilename (module.js:336:15)
    at Function.Module._resolveFilename (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/graeme.lambert/.atom/packages/autosave/lib/autosave.coffee:2:6)
    at Object.<anonymous> (/Users/graeme.lambert/.atom/packages/autosave/lib/autosave.coffee:1:1)
    at Module._compile (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:720:27)
    at /Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:116:28
    at Package.module.exports.Package.measure (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
    at Package.module.exports.Package.load (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/package.js:106:12)
    at PackageManager.module.exports.PackageManager.loadPackage (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/package-manager.js:445:14)
    at PackageManager.module.exports.PackageManager.loadPackages (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/package-manager.js:395:14)
    at AtomEnvironment.module.exports.AtomEnvironment.startEditorWindow (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:684:21)
    at module.exports (/Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/src/initialize-application-window.js:28:10)
    at setupWindow (file:///Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/static/index.js:86:5)
    at window.onload (file:///Users/graeme.lambert/Downloads/Atom.app/Contents/Resources/app.asar/static/index.js:41:9)

Commands

Config

{
  "core": {}
}

Installed Packages

# User
autosave, v0.23.1
event-kit, v2.0.0
fs-plus, v2.8.1
nuclide, v0.125.0
php-hyperclick, v0.3.1

# Dev
No dev packages

Not sure if autosave is working

When a pane has lost focus and then I try to close the window at some point, I'm asked if I want to save changes. this just started happening but I've found that sometimes it has duplicated my files if I have the same pane open twice...

Autosave doesn't cooperate with atom-coffeescript-preview plugin

Here's the error I get when I open the preview window. It's not a blocker, but someone should look into it. I suspect that autosave expects views to have a getModel method in the prototype, but I think that this one deliberately doesn't, since it's not mapped to an open file anywhere.

Let me know if this requires a fix from the plugin author, and I'll create an issue there for him to follow up.

Error:

Uncaught TypeError: Object #<CoffeePreviewView> has no method 'getModel' 
/Applications/Atom.app/Contents/Resources/app/node_modules/autosave/lib/autosave.js:14

Is checkbox "Enabled" needed in the Settings of a package?

Is there any reason of having the 'Enabled' tick box in configuration, when there is already Enable/Disable provided by Package Manager?

Removing this tickbox will also solve other open issues, where people say it does not have an effect.

P.S. Thank you for incredibly valuable package.

There are two license files in the repository

There are right now two license files in the repository, LICENSE and LICENSE.md. Although both indicate the MIT license, this is abnormal and confusing: there should only be one license file.

Error raised on tab close

Started with v0.101.0, whenever I close a tab, the autosave package raise an exception. The autosave option is disabled.

Uncaught TypeError: Object #<PaneView> has no method 'getModel' autosave.coffee:9
(anonymous function) autosave.coffee:9
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360
jQuery.event.trigger /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4594
jQuery.event.simulate /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4893
handler /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:5009
jQuery.fn.extend.remove /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:5501
module.exports.EditorView.remove editor-view.coffee:805
module.exports.PaneView.onItemRemoved pane-view.coffee:170
(anonymous function) pane-view.coffee:1
(anonymous function) /Users/cedric/github/atom/node_modules/emissary/lib/emitter.js:133
module.exports.Emitter.emit /Users/cedric/github/atom/node_modules/emissary/lib/emitter.js:132
module.exports.Pane.removeItem pane.coffee:173
module.exports.Pane.destroyItem pane.coffee:200
module.exports.Pane.destroyActiveItem pane.coffee:191
module.exports.Workspace.destroyActivePaneItem workspace.coffee:268
_results.push._this.(anonymous function) /Users/cedric/github/atom/node_modules/delegato/lib/delegator.js:67
(anonymous function) workspace-view.coffee:157
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360
module.exports.KeymapManager.dispatchCommandEvent /Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js:395
module.exports.KeymapManager.handleKeyboardEvent /Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js:176
(anonymous function) window-event-handler.coffee:61
jQuery.event.dispatch /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4676
elemData.handle /Users/cedric/github/atom/node_modules/space-pen/vendor/jquery.js:4360

It does not prevent the tab from being closed but just pop the console out.

Description of Autosave package does not match actual defaults

The Read Me text reads: "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 (cmd-,).". However, upon very first use of a virgin Atom v1.3.3 on a OS X 10.9.5 (Mavericks) system where I have never used Atom before the service was enabled.

Provide an api for other plugins to suspend autosave if they have a edit panel open

I've run into the same issue (which I thought to be the fault of the packages themselves) caused by autosave in the following packages:

Each time an atom panel is launched by a package (NT launches a modal when you want to create a new file, and Emmet creates a panel in interactive mode) and atom is unfocused, autosave kicks in, and wrecks havoc (the modal disappears in NT, the emmet preview changes are saved which results in the need to undo if one unfocused to quickly check syntax).

If autosave could provide a mechanism for temporary disabling, plugins could make use of it when they have pending actions that would be ruined by autosaving.

Autosave to temporary file

It would be extremely useful if this gave the option to save to a temporary file rather than the regular file, since overwriting the on-disk version of a file is not always desired, but preserving a copy of all changes made in memory is always useful.

Uncaught TypeError: Cannot read property 'addWarning' of undefined

I am sorry but i have no idea how I got to here... I cannot even close the file in atom though.

Atom Version: 1.2.3
System: Mac OS X 10.11.1
Thrown From: autosave package, v0.23.0

Stack Trace

Uncaught TypeError: Cannot read property 'addWarning' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:794

TypeError: Cannot read property 'addWarning' of undefined
    at /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:794:43
    at Pane.module.exports.Pane.handleSaveError (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:800:16)
    at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:534:16)
    at Object.module.exports.autosavePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:64:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autosave/lib/autosave.js:29:26

Commands

  3x -0:30.4.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:26.1.0 editor:delete-line (atom-text-editor.editor.is-focused)
  3x -0:23 core:save (atom-text-editor.editor.is-focused)
     -0:06.5.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:06.5.0 git-diff-details:close-git-diff-details (atom-text-editor.editor.is-focused)
     -0:06.5.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:05.3.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:05.3.0 git-diff-details:close-git-diff-details (atom-text-editor.editor.is-focused)
     -0:05.3.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:04.4.0 core:save (atom-text-editor.editor.is-focused)
     -0:03.4.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:03.4.0 git-diff-details:close-git-diff-details (atom-text-editor.editor.is-focused)
     -0:03.4.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:03.1.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:03.1.0 git-diff-details:close-git-diff-details (atom-text-editor.editor.is-focused)
     -0:03.1.0 core:cancel (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "wrap-guide",
      "autocomplete-snippets",
      "snippets",
      "vim-mode"
    ],
    "ignoredNames": [
      ".bin",
      "META*",
      ".DS_Store",
      "*.jar",
      "target",
      "*.iml",
      "*.sublime*",
      "node*",
      "*.class"
    ],
    "projectHome": "/Users/davidanderson/Projects",
    "themes": [
      "atom-material-ui",
      "seti-syntax"
    ],
    "audioBeep": false
  },
  "autosave": {
    "enabled": true
  }
}

Installed Packages

# User
atom-beautify, v0.28.19
atom-material-ui, v0.8.0
bottom-dock, v0.3.5
file-icons, v1.6.11
fonts, v1.0.0
git-diff-details, v0.21.0
git-plus, v5.6.5
git-projects, v1.16.0
highlight-selected, v0.11.1
less-than-slash, v0.11.0
linter, v1.11.2
linter-csslint, v1.1.0
linter-jshint, v1.2.1
linter-less, v2.2.0
linter-manager, v0.2.6
minimap, v4.16.1
minimap-bookmarks, v0.1.0
minimap-codeglance, v0.4.5
minimap-find-and-replace, v4.3.2
minimap-hide, v0.3.0
minimap-linter, v1.0.0
minimap-selection, v4.3.1
pane-manager, v0.1.5
pigments, v0.19.0
project-manager, v2.6.5
seti-syntax, v0.4.1
statusbar-datetime, v0.9.7

# Dev
No dev packages

Uncaught Error: ENOENT: no such file or directory, OPEN /home/ely/Documents/Coding/Bash Mincraft Installer/Enkouyami s Bash Minecraft Installer

Steps to reproduce below:
Opening a broken symlink of a file

Atom Version: 0.194.0
System: linux 3.13.0-37-generic
Thrown From: autosave https://github.com/atom/autosavepackage, v0.20.0

Stack Trace Uncaught Error:

ENOENT: no such file or directory, OPEN/home/ely/Documents/Coding/Bash Mincraft Installer/Enkouyami s Bash Minecraft Installer
At /opt/atom/resources/app.asar/node_modules/pathwatcher/lib/file.js:376
Error: ENOENT: no such file or directory, OPEN/home/ely/Documents/Coding/Bash Mincraft Installer/Enkouyami s Bash Minecraft Installerat Errornativeat Object.fs.OPENSyncfs.js:544:18at Object.module. anonymous FUNCTION as OPENSync ATOM_SHELL_ASAR.js:118:20
Object.fs.writeFileSyncfs.js:1155:15
Object.fsPlus.writeFileSync/opt/atom/resources/app.asar/node_modules/fs-plus/lib/fs-plus.js:240:17
File.module.exports.File.writeFileSync/opt/atom/resources/app.asar/node_modules/pathwatcher/lib/file.js:264:19
File.module.exports.File.writeFileWithPrivilegeEscalationSync/opt/atom/resources/app.asar/node_modules/pathwatcher/lib/file.js:362:21
File.module.exports.File.writeSync/opt/atom/resources/app.asar/node_modules/pathwatcher/lib/file.js:336:12at TextBuffer.module.exports.TextBuffer.saveAs/opt/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:913:17
TextBuffer.module.exports.TextBuffer.save/opt/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:899:19
TextEditor.module.exports.TextEditor.save/opt/atom/resources/app.asar/src/text-editor.js:554:26
Object.module.exports.autosavePaneItem/opt/atom/resources/app.asar/node_modules/autosave/lib/autosave.js:56:80
/opt/atom/resources/app.asar/node_modules/autosave/lib/autosave.js:27:26

Commands

config.json

{
  core: {
    themes: atom - light - ui,
    monokai,
    disabledPackages: language - objective - c,
    language - c,
    language - clojure,
    language - csharp,
    language - java,
    language - toml,
    language - yaml,
    language - sql,
    language - mustache,
    language - php,
    quippet,
    followSymlinks: true,
    autoHideMenuBar: true
  },
  autosave: {
    enabled: true
  }
}

Installed Packages

User

autocomplete-plus, v2.12.0 
autocomplete-snippets, v1.2.0 
file-icons, v1.5.4 
linter, v0.12.0 
linter-shellcheck, v0.0.7 
minimap, v4.7.6 
monokai, v0.14.0

Dev

No dev packages

Moves the caret to next line on save

When I edit text in Atom it always moves my caret to the next line if it's the last line in the document.

Before save:
image
After save:
image

That becomes very annoying when Autosave is enabled. When you write a new document and often switch to another window, Autosave performs save, when you switch back to Atom, you need to return the caret back to continue typing.

I have also enabled Whitespace plugin with Ensure Single Trailing Newline option set to true.

Expected behaviour: new line is added, the document is saved, but the caret leaves there where it originally was.

Autosave triggers on unsavable files

Hi guys.

Some plugins like "atom-coffeescript-preview" are opening a separate tab where a compiled version of the code is visible(CS to JS). The file is a temporary file that doesn't have the getModel() method and therefore causes exception.

A possible fix is to check for the method existence before calling it, although I would suggest actually looking into other alternatives.

This:

    activate: ->
        atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) =>
          editor = $(event.target).closest('.editor').view()?.getModel()
          @autosave(editor)

should be:

    activate: ->
        atom.workspaceView.on 'focusout', ".editor:not(.mini)", (event) =>
          editor = $(event.target).closest('.editor').view()?.getModel?()
          @autosave(editor)

Add setting to selectively autosave based on grammar/scope

I'm using the git-plus package and autosave is enabled.
When I want to commit and I wait to long while composing the commit message, the commit message get autosaved and the commit fired before I finished.

Maybe there should be a setting to blacklist files, which should not be autosaved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.