From 73491ae55f0ded0366bf3d8653d65aa3726efd52 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Tue, 26 Jan 2021 09:35:02 +0100 Subject: [PATCH] #29 - Include file opening --- CHANGELOG.md | 4 ++++ src/commands/Template.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd170853..47163d2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [1.12.0] - 2020-01-26 + +- [#29](https://github.com/estruyf/vscode-front-matter/issues/29): Open file after creating it from the template + ## [1.11.1] - 2020-12-10 - [#26](https://github.com/estruyf/vscode-front-matter/issues/26): Fix for arrow selection in the dropdown. diff --git a/src/commands/Template.ts b/src/commands/Template.ts index 79625df2..9945028b 100644 --- a/src/commands/Template.ts +++ b/src/commands/Template.ts @@ -92,6 +92,8 @@ export class Template { frontMatter = Article.updateDate(frontMatter); fs.writeFileSync(newFilePath, ArticleHelper.stringifyFrontMatter(frontMatter.content, frontMatter.data), { encoding: "utf8" }); + + await vscode.commands.executeCommand('vscode.open', vscode.Uri.file(newFilePath)); } const txtDoc = await vscode.workspace.openTextDocument(vscode.Uri.parse(newFilePath));