Closes #166. Add check for an Active Editor when beautifying

This commit is contained in:
Glavin Wiechert 2015-01-02 14:41:37 -04:00
parent 39d1e945a3
commit 6e708a8922
1 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,11 @@ beautify = ({onSave}) ->
# Get current editor
editor = atom.workspace.getActiveEditor()
# Check if there is an active editor
if not editor?
return @showError(new Error("Active Editor not found. "
"Please select a Text Editor first to beautify."))
isSelection = !!editor.getSelectedText()
# Get editor path and configurations for paths
editedFilePath = editor.getPath()