Skip to content

Commit

Permalink
Disabled the plugin in vim mode
Browse files Browse the repository at this point in the history
  • Loading branch information
rizerphe committed May 3, 2023
1 parent 954bdde commit 0457745
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ export default class Companion extends Plugin {
const view = this.app.workspace.getActiveViewOfType(MarkdownView);
if (!view) return "";
if (!this.enabled) return "";
if ((view.editor as any)?.cm?.cm?.state?.keyMap === "vim") {
// Don't complete if vim mode is enabled
// (hehe I know more about the types than typescript does)
// (thus I can use "as any" wooooo)
return "";
}

const cursor = view.editor.getCursor();
const currentLine = view.editor.getLine(cursor.line);
Expand Down

0 comments on commit 0457745

Please sign in to comment.