Closes #166. Add check for an Active Editor when beautifying
This commit is contained in:
parent
39d1e945a3
commit
6e708a8922
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue