mirror of
https://github.com/rabirabirara/obsidian-jelly-snippets.git
synced 2026-07-22 07:30:22 +00:00
refac: use activeEditor, not getActiveViewOfType
This commit is contained in:
parent
2aaeae8467
commit
7170e62912
1 changed files with 3 additions and 3 deletions
6
main.ts
6
main.ts
|
|
@ -71,9 +71,9 @@ export default class JellySnippets extends Plugin {
|
|||
(!evt.shiftKey) // TODO: add function to determine when not to trigger. don't trigger if shift is pressed down as well e.g.
|
||||
) {
|
||||
// TODO: Add a dropdown setting so that users can control which modifier key cancels things out, or if any does at all.
|
||||
const view = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (view) {
|
||||
this.triggerSearchSnippetAutomatically(view.editor, evt);
|
||||
const mdFile = this.app.workspace.activeEditor;
|
||||
if (mdFile?.editor) {
|
||||
this.triggerSearchSnippetAutomatically(mdFile.editor, evt);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue