Skip to content

Commit

Permalink
fix: Mitigate edge cases where a blank string is appending during tra…
Browse files Browse the repository at this point in the history
…nsition between active editors

Merge pull request #1369 from johnfromoptus/master
Update Templater.ts
  • Loading branch information
Zachatoo committed May 8, 2024
2 parents 940e2f1 + 4bfe4a9 commit b6dd0b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/Templater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ export class Templater {
const oldSelections = doc.listSelections();
doc.replaceSelection(output_content);
// Refresh editor to ensure properties widget shows after inserting template in blank file
await app.vault.append(active_editor.file, "");

if(active_editor.file){
await app.vault.append(active_editor.file, "");
}
app.workspace.trigger("templater:template-appended", {
view: active_view,
editor: active_editor,
Expand Down

0 comments on commit b6dd0b1

Please sign in to comment.