From 0457745cbc4139f0265c8a0681ad20fbc70bc870 Mon Sep 17 00:00:00 2001 From: rizerphe <44440399+rizerphe@users.noreply.github.com> Date: Wed, 3 May 2023 21:57:54 +0300 Subject: [PATCH] Disabled the plugin in vim mode --- src/main.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.tsx b/src/main.tsx index 419ee7f..6e570ab 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -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);