6 Commits
Author SHA1 Message Date
Seongjae Lee 74735eec82 Prepare 0.8.0 release 2015-09-12 10:52:12 -07:00
Seongjae Lee fa873af344 Update changelog 2015-09-12 10:51:48 -07:00
Seongjae Lee a31f490a70 Fix a bug on warning messages
Ruby-style string interpolation is only with double-quoted strings.
2015-09-12 10:49:44 -07:00
Seongjae Lee 27f2a5bb8d Delete an empty note when closing a pane
Close #18. This is against nvALT, but I think this is more intuitive way.
2015-09-12 10:47:29 -07:00
Seongjae Lee 95093df286 Prepare 0.7.1 release 2015-09-12 10:17:10 -07:00
Seongjae Lee 5e4345f719 Make autosave also consider nvatom.extensions 2015-09-12 10:16:52 -07:00
3 changed files with 19 additions and 5 deletions
+3
View File
@@ -1,3 +1,6 @@
## 0.8.0
- Add a feature to delete an empty note automatically when closing its pane
## 0.7.0
- Add `extensions` setting
+15 -4
View File
@@ -47,7 +47,7 @@ module.exports =
window.addEventListener('blur', handleBlur, true)
@subscriptions.add new Disposable -> window.removeEventListener('blur', handleBlur, true)
@subscriptions.add atom.workspace.onWillDestroyPaneItem ({item}) => @autosave(item)
@subscriptions.add atom.workspace.onWillDestroyPaneItem ({item}) => @autosave(item) unless @autodelete(item)
deactivate: ->
@subscriptions.dispose()
@@ -67,9 +67,20 @@ module.exports =
return unless paneItem?.isModified?()
uri = paneItem.getURI()
return unless uri.indexOf(@rootDirectory) == 0
return unless fs.isMarkdownExtension(path.extname(uri))
return unless path.extname(uri) in atom.config.get('nvatom.extensions')
paneItem?.save?()
autodelete: (paneItem) ->
return false unless paneItem?.getURI?()?
uri = paneItem.getURI()
return false unless uri.indexOf(@rootDirectory) == 0
return false unless path.extname(uri) in atom.config.get('nvatom.extensions')
return false unless paneItem?.isEmpty()
fs.unlinkSync(uri)
noteName = uri.substring(@rootDirectory.length + 1)
atom.notifications.addInfo("Empty note #{noteName} is deleted.")
return true
autosaveAll: ->
@autosave(paneItem) for paneItem in atom.workspace.getPaneItems()
@@ -79,7 +90,7 @@ module.exports =
defaultNoteDirectory = path.join(packagesDirectory, 'nvatom', 'notebook')
if noteDirectory.startsWith(packagesDirectory)
throw new Error('Note directory #{noteDirectory} cannot reside within atom packages directory. Please change its value from package settings.')
throw new Error("Note directory #{noteDirectory} cannot reside within atom packages directory. Please change its value from package settings.")
# Initialize note directory.
if !fs.existsSync(noteDirectory)
@@ -104,7 +115,7 @@ module.exports =
atom.notifications.addInfo('Migrating from notational-velocity package...')
if !fs.existsSync(prevNoteDirectory)
atom.notifications.addError('notational-velocity.directory #{prevNoteDirectory} does not exists. Migration process is failed.')
atom.notifications.addError("notational-velocity.directory #{prevNoteDirectory} does not exists. Migration process is failed.")
return
if prevNoteDirectory.startsWith(packagesDirectory)
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "nvatom",
"main": "./lib/notational-velocity",
"version": "0.7.0",
"version": "0.8.0",
"private": true,
"contributors": [
"Seongjae Lee <seongjae@gmail.com>",