chexwarrior / atom-autosave-onchange Goto Github PK
View Code? Open in Web Editor NEWSaves you time by saving your code automatically every time you make a change
License: MIT License
Saves you time by saving your code automatically every time you make a change
License: MIT License
When I click multiple spaces (Enter) they are removed by the autosave. Need to place a # for comment or move something else.
[Enter steps to reproduce:]
Atom: 1.14.3 x64
Electron: 1.3.13
OS: Microsoft Windows 7 Enterprise
Thrown From: autosave-onchange package 1.1.0
Uncaught Error: Can't save destroyed buffer
At C:\Users\Null\AppData\Local\atom\app-1.14.3\resources\app.asar\node_modules\text-buffer\lib\text-buffer.js:1055
Error: Can't save destroyed buffer
at TextBuffer.module.exports.TextBuffer.saveAs (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1055:15)
at TextBuffer.module.exports.TextBuffer.save (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1049:19)
at TextEditor.module.exports.TextEditor.save (/app.asar/src/text-editor.js:891:26)
at Package.trigger (/packages/autosave-onchange/lib/package.js:27:16)
at Package.onDidChangeCursorPosition (/packages/autosave-onchange/lib/package.js:11:18)
at /packages/autosave-onchange/lib/autosave-delay.js:47:29
at invokeFunc (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:160:19)
at trailingEdge (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:207:14)
at timerExpired (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:195:14)
-2:33.3.0 editor:consolidate-selections (input.hidden-input)
-2:33.3.0 core:cancel (input.hidden-input)
-2:30.1.0 command-palette:toggle (input.hidden-input)
17x -2:23.8.0 core:backspace (input.hidden-input)
-2:17.9.0 editor:consolidate-selections (input.hidden-input)
-2:17.9.0 core:cancel (input.hidden-input)
13x -2:15.9.0 git-plus:add (input.hidden-input)
-2:15.6.0 command-palette:toggle (input.hidden-input)
-2:14.1.0 editor:consolidate-selections (input.hidden-input)
-2:14.1.0 core:cancel (input.hidden-input)
-2:05.5.0 git-plus:add (input.hidden-input)
-2:00.6.0 application:add-project-folder (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
-2:00.6.0 tree-view:copy-full-path (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
2x -1:52.3.0 git-plus:commit (input.hidden-input)
-0:51.1.0 command-palette:toggle (input.hidden-input)
-0:47.4.0 git-plus:commit-amend (input.hidden-input)
advanced-open-file 0.16.5
atom-beautify 0.29.17
atom-ternjs 0.17.2
autoreload-package-service 0.0.4
autosave-onchange 1.1.0
duplicate-line-or-selection 0.9.0
emmet 2.4.3
emmet-snippets-compatibility 1.0.6
git-clone 0.2.0
git-control 0.8.2
git-plus 7.3.0
language-javascript-jsx 0.3.7
minimap 4.26.8
platformio-ide-terminal 2.2.3
[Enter steps to reproduce:]
Atom: 1.16.0-beta0 x64
Electron: 1.3.13
OS: Mac OS X 10.12.3
Thrown From: autosave-onchange package 1.1.0
Failed to activate the autosave-onchange package
At /Users/null/.atom/packages/autosave-onchange/lib/autosave-delay.js: package is a reserved word in strict mode (22:6)
SyntaxError: /Users/null/.atom/packages/autosave-onchange/lib/autosave-delay.js: package is a reserved word in strict mode (22:6)
20 | import debounce from 'lodash.debounce';
21 |
> 22 | const package = new Package();
| ^
23 |
24 | export default {
25 |
at /app.asar/node_modules/babylon/lib/index.js:4373:13)
at /app.asar/node_modules/babylon/lib/index.js:4270:10)
at /app.asar/node_modules/babylon/lib/index.js:3084:12)
at Parser.checkLVal (/app.asar/node_modules/babylon/lib/index.js:5928:22)
at /app.asar/node_modules/babylon/lib/index.js:2311:8)
at Parser.parseVarHead (/app.asar/node_modules/babylon/lib/index.js:6153:13)
at /app.asar/node_modules/babylon/lib/index.js:2293:10)
at /app.asar/node_modules/babylon/lib/index.js:2124:8)
at /app.asar/node_modules/babylon/lib/index.js:1816:19)
at Parser.parseStatement (/app.asar/node_modules/babylon/lib/index.js:5712:22)
at /app.asar/node_modules/babylon/lib/index.js:2223:21)
at /app.asar/node_modules/babylon/lib/index.js:1733:8)
at Parser.parse (/app.asar/node_modules/babylon/lib/index.js:1628:17)
at parse (/app.asar/node_modules/babylon/lib/index.js:7083:37)
at File.parse (/app.asar/node_modules/babel-core/lib/transformation/file/index.js:527:15)
at File.parseCode (/app.asar/node_modules/babel-core/lib/transformation/file/index.js:612:20)
at /app.asar/node_modules/babel-core/lib/transformation/pipeline.js:49:12
at File.wrap (/app.asar/node_modules/babel-core/lib/transformation/file/index.js:574:16)
at Pipeline.transform (/app.asar/node_modules/babel-core/lib/transformation/pipeline.js:47:17)
at Object.exports.compile (/app.asar/src/babel.js:72:16)
at Object.compile (/app.asar/src/package-transpilation-registry.js:54:27)
at compileFileAtPath (/app.asar/src/compile-cache.js:91:31)
at /app.asar/src/compile-cache.js:215:18)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (/app.asar/src/native-compile-cache.js:50:27)
at Package.module.exports.Package.requireMainModule (/app.asar/src/package.js:796:27)
at Package.module.exports.Package.activateNow (/app.asar/src/package.js:207:16)
advanced-open-file 0.16.5
atom-beautify 0.29.17
atom-live-server 2.1.2
atom-ternjs 0.18.1
autosave-onchange 1.1.0
duplicate-line-or-selection 0.9.0
emmet 2.4.3
emmet-snippets-compatibility 1.0.6
git-clone 0.2.0
git-control 0.8.2
git-plus 7.3.3
language-babel 2.55.6
language-javascript-jsx 0.3.7
minimap 4.26.8
platformio-ide-terminal 2.4.0
sync-settings 0.8.1
Whenever making a change to file, the save icon blinks blue at top of file (in the tab list). Can this be disabled?
First thing I noticed was that if I hesitate for a split second while typing a sentence then the file is autosaved and the trailing space removed. I resume typing but now have typo :(
[Enter steps to reproduce:]
Atom: 1.15.0 x64
Electron: 1.3.13
OS: Linux Mint
Thrown From: autosave-onchange package 1.1.0
Uncaught Error: EACCES: permission denied, open '/home/themorningstar/Documents/djs559.github.io/WEEK2_CSSexercises/index.html'
At /usr/share/atom/resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1076
Error: EACCES: permission denied, open '/home/themorningstar/Documents/djs559.github.io/WEEK2_CSSexercises/index.html'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:168:20)
at Object.fs.writeFileSync (fs.js:1343:33)
at Object.writeFileSync (/app.asar/node_modules/fs-plus/lib/fs-plus.js:281:17)
at File.module.exports.File.writeFileSync (/app.asar/node_modules/text-buffer/node_modules/pathwatcher/lib/file.js:285:19)
at File.module.exports.File.writeFileWithPrivilegeEscalationSync (/app.asar/node_modules/text-buffer/node_modules/pathwatcher/lib/file.js:463:21)
at File.module.exports.File.writeSync (/app.asar/node_modules/text-buffer/node_modules/pathwatcher/lib/file.js:380:12)
at TextBuffer.module.exports.TextBuffer.saveAs (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1067:19)
at TextBuffer.module.exports.TextBuffer.save (/app.asar/node_modules/text-buffer/lib/text-buffer.js:1048:19)
at TextEditor.module.exports.TextEditor.save (/app.asar/src/text-editor.js:915:26)
at Package.trigger (/packages/autosave-onchange/lib/package.js:27:16)
at Package.onDidChangeCursorPosition (/packages/autosave-onchange/lib/package.js:11:18)
at /packages/autosave-onchange/lib/autosave-delay.js:47:29
at invokeFunc (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:160:19)
at trailingEdge (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:207:14)
at timerExpired (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:195:14)
-3:51.2.0 command-palette:toggle (input.hidden-input)
-3:41.9.0 core:confirm (input.hidden-input)
-3:41.9.0 tree-view:show (input.hidden-input)
-3:33.4.0 tree-view:toggle-focus (input.hidden-input)
2x -3:26.4.0 application:open-file (input.hidden-input)
-1:43.6.0 snippets:next-tab-stop (input.hidden-input)
-1:43.6.0 snippets:expand (input.hidden-input)
-1:43.5.0 editor:indent (input.hidden-input)
3x -1:41.7.0 core:backspace (input.hidden-input)
-1:39.8.0 snippets:next-tab-stop (input.hidden-input)
-1:39.8.0 snippets:expand (input.hidden-input)
-1:39.7.0 editor:indent (input.hidden-input)
4x -1:39.1.0 core:backspace (input.hidden-input)
2x -1:36.7.0 core:save (input.hidden-input)
-0:30 core:backspace (input.hidden-input)
-0:27.9.0 emmet:expand-abbreviation-with-tab (input.hidden-input)
atom-html-preview 0.1.22
autosave-onchange 1.1.0
emmet 2.4.3
Hi! Thanks for maintaining the autosave-onchange package!
In Atom v1.19, we will release a major change to Atom's core text buffer data structure. As part of this change, we have made TextBuffer.save
asynchronous; rather than blocking until the save is complete, it now immediately returns a Promise
that resolves when the save is complete. Because of this, a few other Atom APIs that use save
have similarly become async:
Pane.close
TextBuffer.save
TextEditor.save
Pane.saveItem
Pane.saveItemAs
Pane.saveActiveItem
Pane.saveActiveItemAs
Pane.saveItems
Workspace.saveActivePaneItem
Workspace.saveActivePaneItemAs
We think this package could be impacted by this upgrade because it calls the changed methods in the following places:
TextEditor.save
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:
Please let me know if you have any questions. I'd be happy to help!
[Enter steps to reproduce:]
Atom: 1.30.0 x64
Electron: 2.0.5
OS: Microsoft Windows 10 Enterprise
Thrown From: autosave-onchange package 1.5.1
Failed to load the autosave-onchange package
At Cannot find module 'lodash.debounce'
Error: Cannot find module 'lodash.debounce'
at Module._resolveFilename (module.js:543:15)
at Module._resolveFilename (~/AppData/Local/atom/app-1.30.0/resources/electron.asar/common/reset-search-paths.js:35:12)
at Function.get_Module._resolveFilename (<embedded>:12380:58)
at Module.require (/app.asar/static/index.js:40:43)
at require (<embedded>:11724:33)
at /packages/atom-autosave-onchange-1.5.1/lib/autosave-onchange.js:15:23)
at /packages/atom-autosave-onchange-1.5.1/lib/autosave-onchange.js:108:3)
at Module.get_Module._compile (<embedded>:11764:36)
at Object.value [as .js] (<embedded>:12016:29)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (/app.asar/static/index.js:47:45)
at require (internal/module.js:11:18)
at customRequire (<embedded>:96:26)
at Package.requireMainModule (<embedded>:75880:33)
at measure (<embedded>:75241:22)
at Package.measure (<embedded>:75186:25)
at Package.load (<embedded>:75227:16)
at PackageManager.loadAvailablePackage (<embedded>:26124:16)
at config.transact (<embedded>:26037:20)
at Config.transact (<embedded>:22707:20)
at PackageManager.loadPackages (<embedded>:26035:23)
at loadStatePromise.loadState.then (<embedded>:1080:27)
at <anonymous>:null:null
autosave-onchange 1.5.1
[Enter steps to reproduce:]
Atom: 1.18.0 x64
Electron: 1.3.15
OS: Microsoft Windows 10 Home Single Language
Thrown From: autosave-onchange package 1.5.1
Uncaught Error: EPERM: operation not permitted, mkdir 'C:\xampp\htdocs\scheduler\resources\views\pages\users\osa-user\organization'
At C:\atom\app-1.18.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:1136
Error: EPERM: operation not permitted, mkdir 'C:\xampp\htdocs\scheduler\resources\views\pages\users\osa-user\organization'
at Error (native)
at fs.mkdirSync (fs.js:922:18)
at Object.fs.mkdirSync (ELECTRON_ASAR.js:665:16)
at Function.sync (C:/atom/app-1.18.0/resources/app/node_modules/mkdirp/index.js:81:19)
at Proxy.writeFileSync (C:/atom/app-1.18.0/resources/app/node_modules/fs-plus/lib/fs-plus.js:297:20)
at File.module.exports.File.writeFileSync (C:/atom/app-1.18.0/resources/app/node_modules/pathwatcher/lib/file.js:289:25)
at File.module.exports.File.writeFileWithPrivilegeEscalationSync (C:/atom/app-1.18.0/resources/app/node_modules/pathwatcher/lib/file.js:467:27)
at File.module.exports.File.writeSync (C:/atom/app-1.18.0/resources/app/node_modules/pathwatcher/lib/file.js:384:18)
at TextBuffer.module.exports.TextBuffer.saveAs (C:/atom/app-1.18.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1127:25)
at TextBuffer.module.exports.TextBuffer.save (C:/atom/app-1.18.0/resources/app/node_modules/text-buffer/lib/text-buffer.js:1108:25)
at TextEditor.module.exports.TextEditor.save (C:/atom/app-1.18.0/resources/app/src/text-editor.js:925:32)
at Package.trigger (/packages/autosave-onchange/lib/package.js:23:28)
at Package.onDidChangeCursorPosition (/packages/autosave-onchange/lib/package.js:9:12)
at /packages/autosave-onchange/lib/autosave-onchange.js:82:18
at invokeFunc (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:160:19)
at trailingEdge (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:207:14)
at timerExpired (/packages/autosave-onchange/node_modules/lodash.debounce/index.js:195:14)
-7:00.6.0 core:select-all (input.hidden-input)
-6:59.6.0 core:cut (input.hidden-input)
-6:55.6.0 core:select-all (input.hidden-input)
2x -6:54.3.0 core:paste (input.hidden-input)
-5:50.6.0 find-and-replace:show (input.hidden-input)
4x -5:46.9.0 core:confirm (input.hidden-input)
-5:41.3.0 core:move-right (input.hidden-input)
-5:34.2.0 core:move-left (input.hidden-input)
-5:29.8.0 find-and-replace:show (input.hidden-input)
6x -5:27.9.0 core:confirm (input.hidden-input)
-5:17.7.0 core:backspace (input.hidden-input)
3x -5:15.9.0 core:move-right (input.hidden-input)
-5:10.5.0 core:backspace (input.hidden-input)
-5:10 core:move-right (input.hidden-input)
41x -5:01.8.0 core:backspace (input.hidden-input)
-0:00.2.0 core:save (input.hidden-input)
alignment 1.1.5
atom-bootstrap3 1.2.12
atom-terminal 0.8.0
autosave-onchange 1.5.1
base-16-ocean-dark-ui-theme 1.7.2
browser-plus 0.0.98
browser-plus-block 0.0.4
browser-plus-open-new-window 0.0.1
chameleon-ui 1.0.0
chester-atom-2-syntax 0.1.0
chester-syntax 0.4.0
docblockr 0.10.5
editor-background 1.2.38
emmet 2.4.3
facebook-syntax-theme 1.2.1
fizzy-syntax-theme 0.9.0
focus-ui 2.6.0
fox-syntax-theme 1.2.0
gruvbox-plus-syntax 1.3.1
hecs-dark-theme-syntax 0.1.1
icon-fonts 2.16.2
improved-chester-atom-syntax 0.3.0
jonikorpi-atom-theme-ui 4.4.1
lunar-particle-syntax 0.3.8
lunar-particle-ui 0.3.13
lxso-theme 0.0.1
one-dark-vivid-syntax 1.8.0
seti-icons 1.5.4
tasks 2.6.6
tree-view-background 0.4.3
vanian-ui 1.5.4
Changing the delay to a shorter time frame is not possible since after trying to input the change in number to a shorter time delay, the number reset back to 500 ms when the mouse is clicked anywhere outside the number input box.
When i type something new into a file, autosave-onchange does not save it automatically even though i have it installed correctly.
When using autosave-onchange and whitespace plugin with "Ensure Single Trailing Whitespace", one's ability to edit the file at it's end is reduced, since autosave-onchange saves the file every 500ms, and whitespace automatically removes the whitespace at the end.
I love to create a few new lines to start a new paragraph before thinking of what exactly should I be writing right now, and then autosave-onchange kicks in and saves the file. Whitespace plugin, triggered by autosave-onchange, will remove all of the newly created whitespace (although it is useful in this case). It is unreasonably annoying - requires me to always add a non-empty line, so that this behaviour wouldn't distract me.
I can also see how this functionality may require more work than the amount of work it takes to fix it in the first place. So in such scenario it may be nice to hear the opinions of the official maintainers of the plugin.
Also not exactly sure if that's a whitespace
or an autosave-onchange
issue.
Expected behavior:
I expect the whitespace to be automatically removed when I am not directly editing the file (e.g. when autosave-onchange runs after I had removed the caret from the end of file).
Actual behavior:
Whitespace plugin runs immediately and removes the useful newlines.
Reproduces how often:
100%.
Atom : 1.31.2
Electron: 2.0.7
Chrome : 61.0.3163.100
Node : 8.9.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.