修复切换 markdown 文档后错误匹配到当前文档名的 bug

This commit is contained in:
朽朽朽朽朽 2025-04-01 22:27:58 +08:00
parent a7ff0879f6
commit 9cc2ca54e3
3 changed files with 4 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{
"id": "one-step-wiki-link",
"name": "One Step Wiki Link",
"version": "1.0.1",
"version": "1.0.2",
"minAppVersion": "1.8.0",
"description": "一步添加 wiki 链接",
"author": "Busyo",

View file

@ -1,6 +1,6 @@
{
"name": "one-step-wiki-link",
"version": "1.0.1",
"version": "1.0.2",
"description": "一步添加 wiki 链接",
"main": "main.js",
"scripts": {

View file

@ -102,6 +102,8 @@ export default class OneStepWikiLinkPlugin extends Plugin {
this.openEditor = leaf.view.app.workspace.activeEditor?.editor;
// console.log(this.openEditor);
if (this.openEditor) {
this.currentFileName = ((leaf.view as MarkdownView).file as TFile).basename;
// console.log((leaf.view as MarkdownView).file?.basename);
this.checkContent(this.openEditor.getValue());
}
} else if (type == "empty") {