Merge pull request #8 from alefragnani/NoActiveFile

Closes #7 - Error (in console) when there is no active file
This commit is contained in:
Sean McBreen 2017-04-05 09:15:27 -07:00 коммит произвёл GitHub
Родитель 63ffb1c13e f95713910a
Коммит 0e6eb613bc
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -70,6 +70,12 @@ function processSelection(e: TextEditor, d: TextDocument, sel: Selection[], form
// Main menu ///////////////////////////////////// // Main menu /////////////////////////////////////
function textFunctions() { function textFunctions() {
if (!vscode.window.activeTextEditor) {
vscode.window.showInformationMessage('Open a file first to manipulate text selections');
return;
}
var opts: QuickPickOptions = { matchOnDescription: true, placeHolder: "What do you want to do to the selection(s)?" }; var opts: QuickPickOptions = { matchOnDescription: true, placeHolder: "What do you want to do to the selection(s)?" };
var items: QuickPickItem[] = []; var items: QuickPickItem[] = [];