diff --git a/main.js b/main.js index 25bd3137..d5eda26f 100644 --- a/main.js +++ b/main.js @@ -5189,7 +5189,7 @@ function escapeRegex(string) { return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); } -const getCurrFile = () => { var _a; return (_a = app.workspace.getActiveFile()) !== null && _a !== void 0 ? _a : app.workspace.getMostRecentlyActiveFile(); }; +const getCurrFile = () => app.workspace.getActiveFile(); /** * Get basename from a **Markdown** `path` * @param {string} path diff --git a/src/Utils/ObsidianUtils.ts b/src/Utils/ObsidianUtils.ts index 39ae232a..8d7bca71 100644 --- a/src/Utils/ObsidianUtils.ts +++ b/src/Utils/ObsidianUtils.ts @@ -14,7 +14,7 @@ import type { MetaeditApi } from "../interfaces"; import type BCPlugin from "../main"; import { splitAndTrim } from "./generalUtils"; -export const getCurrFile = (): TFile | null => app.workspace.getActiveFile() ?? app.workspace.getMostRecentlyActiveFile() +export const getCurrFile = (): TFile | null => app.workspace.getActiveFile() /** * Get basename from a **Markdown** `path`