From 1dbd26c828ecdfab1d628fa6a17e88bde5ddb509 Mon Sep 17 00:00:00 2001 From: Jon Noronha Date: Thu, 24 Mar 2022 12:32:59 -0700 Subject: [PATCH] lint fix --- packages/suggestion/src/findSuggestionMatch.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/suggestion/src/findSuggestionMatch.ts b/packages/suggestion/src/findSuggestionMatch.ts index 888f4b6e..68599f80 100644 --- a/packages/suggestion/src/findSuggestionMatch.ts +++ b/packages/suggestion/src/findSuggestionMatch.ts @@ -32,7 +32,11 @@ export function findSuggestionMatch(config: Trigger): SuggestionMatch { : new RegExp(`${prefix}(?:^)?${escapedChar}[^\\s${escapedChar}]*`, 'gm') const text = $position.nodeBefore?.isText && $position.nodeBefore.text - if (!text) return null + + if (!text) { + return null + } + const textFrom = $position.pos - text.length const match = Array.from(text.matchAll(regexp)).pop()