Skip to content

Commit

Permalink
fix: place cursor after frontmatter
Browse files Browse the repository at this point in the history
refs: #1231
  • Loading branch information
Zachatoo committed Nov 7, 2023
1 parent 9bccec9 commit a65bc08
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/Templater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export class Templater {
template_file: TFile,
file: TFile
): Promise<void> {
const active_editor = app.workspace.activeEditor;
const running_config = this.create_running_config(
template_file,
file,
Expand All @@ -247,6 +248,10 @@ export class Templater {
return;
}
await app.vault.modify(file, output_content);
if (active_editor && active_editor.editor) {
const editor = active_editor.editor;
editor.setSelection({ line: 0, ch: 0 }, { line: 0, ch: 0 });
}
app.workspace.trigger("templater:new-note-from-template", {
file,
content: output_content,
Expand Down

0 comments on commit a65bc08

Please sign in to comment.