feat: update auto-completion logic

This commit is contained in:
Yaotian-Liu 2023-03-24 21:00:50 +08:00
parent 3084c1ac08
commit 8622d54950
No known key found for this signature in database
GPG key ID: 4AEEE42596AA7552

View file

@ -211,6 +211,10 @@ class PseudocodeSuggestor extends EditorSuggest<string> {
// 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("```");