mirror of
https://github.com/wassname/nvatom.git
synced 2026-06-27 16:10:36 +08:00
Fix #52 to prevent spitting an error message when whitespace package is not active
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user