From 8622d54950c10c9aaddac3faaa5c43ab66b0773e Mon Sep 17 00:00:00 2001 From: Yaotian-Liu Date: Fri, 24 Mar 2023 21:00:50 +0800 Subject: [PATCH] feat: update auto-completion logic --- main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.ts b/main.ts index 346f110..cb6410d 100644 --- a/main.ts +++ b/main.ts @@ -211,6 +211,10 @@ class PseudocodeSuggestor extends EditorSuggest { // if there is no word, return null if (currentLineLastWordStart === -1) return null; + // If is within a LaTeX $$ wrap, return null + const currentLineLastMoneyMark = currentLineToCursor.lastIndexOf("$"); + if (currentLineLastMoneyMark != -1) return null; + const currentFileToCursor = editor.getRange({ line: 0, ch: 0 }, cursor); const indexOfLastCodeBlockStart = currentFileToCursor.lastIndexOf("```");