See #237. Fix bug in Debug command when Text Editor not selected

This commit is contained in:
Glavin Wiechert 2015-03-16 10:37:19 -03:00
parent d91421b628
commit 114e67a278
1 changed files with 7 additions and 6 deletions

View File

@ -213,6 +213,13 @@ beautifyDirectory = ({target}) ->
debug = () ->
# Get current editor
editor = atom.workspace.getActiveTextEditor()
# Check if there is an active editor
if not editor?
return confirm("Active Editor not found.\n"+
"Please select a Text Editor first to beautify.")
return unless confirm('Are you ready to debug Atom Beautify?\n\n'+
'Warning: This will change your current clipboard contents.')
@ -243,12 +250,6 @@ debug = () ->
addHeader(2, "Original file to be beautified")
# Original file
# Get current editor
editor = atom.workspace.getActiveTextEditor()
# Check if there is an active editor
if not editor?
return showError(new Error("Active Editor not found.\n"
"Please select a Text Editor first to beautify."))
# Get editor path and configurations for paths
filePath = editor.getPath()