Skip to content

Commit a1a0180

Browse files
committed
fix: Folder templates preventing properties widget from rendering
refs: #1651, #1644, #1647
1 parent 0cd9a03 commit a1a0180

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/core/Templater.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ export class Templater {
345345
// https://github.com/SilentVoid13/Templater/issues/1231
346346
const editor = active_editor.editor;
347347
editor.setSelection({ line: 0, ch: 0 }, { line: 0, ch: 0 });
348+
// Wait for view to finish rendering properties widget
349+
await delay(100);
348350
// Save the file to ensure modifications saved to disk by the time `on_all_templates_executed` callback is executed
349351
// https://github.com/SilentVoid13/Templater/issues/1569
350352
await active_view.save();

src/editor/CursorJumper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
EditorTransaction,
66
MarkdownView,
77
} from "obsidian";
8-
import { escape_RegExp } from "utils/Utils";
8+
import { delay, escape_RegExp } from "utils/Utils";
99

1010
export class CursorJumper {
1111
constructor(private app: App) {}
@@ -35,6 +35,8 @@ export class CursorJumper {
3535
});
3636
if (active_editor instanceof MarkdownView) {
3737
active_editor.currentMode.applyFoldInfo(fold_info);
38+
// Wait for view to finish rendering properties widget
39+
await delay(100);
3840
// Save the file to ensure modifications saved to disk by the time `on_all_templates_executed` callback is executed
3941
// https://github.com/SilentVoid13/Templater/issues/1569
4042
active_editor.save();

0 commit comments

Comments
 (0)