mirror of
https://github.com/kdnk/obsidian-automatic-linker.git
synced 2026-07-22 05:37:46 +00:00
chore: use save to check if we should show the command in command palette
This commit is contained in:
parent
44d1b68dd6
commit
de99f3a37c
1 changed files with 5 additions and 3 deletions
|
|
@ -434,13 +434,15 @@ export default class AutomaticLinkerPlugin extends Plugin {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!checking) {
|
||||
if (checking) {
|
||||
return save(checking);
|
||||
} else {
|
||||
const currentCuror = cm.getCursor();
|
||||
safeWrite("save", async () => {
|
||||
await throttledFormatOnSave();
|
||||
await save(checking);
|
||||
});
|
||||
safeWrite("save", async () => {
|
||||
await save?.();
|
||||
await throttledFormatOnSave();
|
||||
});
|
||||
cm.setCursor({
|
||||
line: currentCuror.line,
|
||||
|
|
|
|||
Loading…
Reference in a new issue