From 4f000ad8c137db8d93ce26053027542c5291ff65 Mon Sep 17 00:00:00 2001 From: Lukas Platzer Date: Thu, 18 Aug 2016 13:13:56 +0200 Subject: [PATCH] Fixed bug #613 --- src/cmd_line/commands/writequit.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd_line/commands/writequit.ts b/src/cmd_line/commands/writequit.ts index 0f27e43fb4d..454be4790b3 100644 --- a/src/cmd_line/commands/writequit.ts +++ b/src/cmd_line/commands/writequit.ts @@ -39,9 +39,9 @@ export class WriteQuitCommand extends node.CommandBase { // Writing command. Taken as a basis from the "write.ts" file. execute(modeHandler : ModeHandler) : void { - var filename : RegExp = new RegExp("Untitled-[0-9]*"); - if (!this.activeTextEditor.document.isDirty) { - if (filename.test(this.activeTextEditor.document.fileName)) { + if (this.activeTextEditor.document.isDirty) { + + if (this.activeTextEditor.document.isUntitled) { vscode.commands.executeCommand("workbench.action.files.saveAs"); } else { vscode.commands.executeCommand("workbench.action.files.save");