Skip to content

Commit

Permalink
fix: #68
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyloong committed Nov 15, 2024
1 parent b3508aa commit 7a154c2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"author": "lazyloong",

"minAppVersion": "1.0.0",
"version": "2.27.9"
"version": "2.27.10"
}
4 changes: 4 additions & 0 deletions obsidian.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@ declare module "obsidian" {
useSelectedItem(e: KeyboardEvent): boolean;
};
}
interface Valut {
getConfig(key: string): any;
setConfig(key: string, value: any): void;
}
}
10 changes: 9 additions & 1 deletion src/editorSuggest/fileEditorSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export default class FileEditorSuggest extends EditorSuggest<MatchData> {
this.index = this.plugin.fileModal.index;
this.scope.register([], "Tab", (e) => {
e.preventDefault();
this.suggestions.useSelectedItem(e);
if (this.app.vault.getConfig("useMarkdownLinks")) {
this.app.vault.setConfig("useMarkdownLinks", false);
this.suggestions.useSelectedItem(e);
this.app.vault.setConfig("useMarkdownLinks", true);
} else this.suggestions.useSelectedItem(e);
});
let prompt = [
{
Expand All @@ -69,6 +73,10 @@ export default class FileEditorSuggest extends EditorSuggest<MatchData> {
command: "输入 |",
purpose: "指定显示的文本",
},
{
command: "tab",
purpose: "使用标准md链接时,仅输入wiki链接,不转换为md链接",
},
];
this.setInstructions(prompt);
}
Expand Down

0 comments on commit 7a154c2

Please sign in to comment.