chore: use save to check if we should show the command in command palette

This commit is contained in:
Kodai Nakamura 2025-05-28 00:27:59 +09:00
parent 44d1b68dd6
commit de99f3a37c

View file

@ -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,