diff --git a/lib/sphinx-preview.js b/lib/sphinx-preview.js index f1fdc5f..5348c7c 100644 --- a/lib/sphinx-preview.js +++ b/lib/sphinx-preview.js @@ -39,7 +39,7 @@ export default { this.openBrowser(); }); } else { - atom.notifications.addWarning('Active file must have reStructuredText extension (.rst)'); + atom.notifications.addWarning('Active file must have reStructuredText extension (.rst) and must be opened as part of a Project Folder'); } }, @@ -218,6 +218,10 @@ export default { }, isActiveFileRst() { + if(!this.getCurrProjectPath()) { + return false; + } + const editor = atom.workspace.getActivePaneItem(); if (!editor || !editor.buffer) return false; const activeFilePath = editor.buffer.file.path;