mirror of
https://github.com/wassname/nvatom.git
synced 2026-09-10 12:21:11 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f005a3025 | ||
|
|
2cbf6a63d7 | ||
|
|
3c36f51fe6 | ||
|
|
956c0017e4 | ||
|
|
0dd99d805b |
@@ -1,3 +1,7 @@
|
||||
## 0.11.0
|
||||
- Make autosave a selectable feature
|
||||
- Fix the bug that shows an error message on save when whitespace package is disabled
|
||||
|
||||
## 0.9.0
|
||||
- Add an interlink feature
|
||||
|
||||
|
||||
@@ -105,9 +105,12 @@ class NotationalVelocityView extends SelectListView
|
||||
if filePath
|
||||
atom.workspace.open(filePath).then (editor) ->
|
||||
save = ->
|
||||
atom.packages.deactivatePackage 'whitespace'
|
||||
isWhiteSpaceActive = atom.packages.isPackageActive 'whitespace'
|
||||
if isWhiteSpaceActive
|
||||
atom.packages.deactivatePackage 'whitespace'
|
||||
editor.save()
|
||||
atom.packages.activatePackage 'whitespace'
|
||||
if isWhiteSpaceActive
|
||||
atom.packages.activatePackage 'whitespace'
|
||||
debouncedSave = _.debounce save, 1000
|
||||
editor.onDidStopChanging () ->
|
||||
debouncedSave() if editor.isModified()
|
||||
|
||||
@@ -23,7 +23,11 @@ module.exports =
|
||||
description: 'Lunr pipeline preprocesses query to make search faster. However, it will skip searching some of stop words such as "an" or "be".'
|
||||
type: 'boolean'
|
||||
default: true
|
||||
|
||||
enableAutosave:
|
||||
title: 'Enable Autosave'
|
||||
description: 'Enable saving the document automatically whenever the user leaves the window or change the tab.'
|
||||
type: 'boolean'
|
||||
default: true
|
||||
|
||||
activate: (state) ->
|
||||
@rootDirectory = @ensureNoteDirectory()
|
||||
@@ -64,6 +68,7 @@ module.exports =
|
||||
@notationalVelocityView
|
||||
|
||||
autosave: (paneItem) ->
|
||||
return unless atom.config.get('nvatom.enableAutosave')
|
||||
return unless paneItem?.getURI?()?
|
||||
return unless paneItem?.isModified?()
|
||||
uri = paneItem.getURI()
|
||||
@@ -81,6 +86,7 @@ module.exports =
|
||||
return true
|
||||
|
||||
autosaveAll: ->
|
||||
return unless atom.config.get('nvatom.enableAutosave')
|
||||
@autosave(paneItem) for paneItem in atom.workspace.getPaneItems()
|
||||
|
||||
ensureNoteDirectory: ->
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "nvatom",
|
||||
"main": "./lib/notational-velocity",
|
||||
"version": "0.10.0",
|
||||
"version": "0.11.0",
|
||||
"private": true,
|
||||
"contributors": [
|
||||
"Seongjae Lee <seongjae@gmail.com>",
|
||||
|
||||
Reference in New Issue
Block a user