fix bug in suggestion extension, fix #143

This commit is contained in:
Philipp Kühn
2021-02-07 20:00:13 +01:00
parent 7d15e5afb9
commit aef0acf53d
2 changed files with 6 additions and 6 deletions

View File

@@ -38,9 +38,9 @@ export function findSuggestionMatch(config: Trigger): SuggestionMatch {
const textFrom = $position.before()
const textTo = $position.pos
const text = $position.doc.textBetween(textFrom, textTo, '\0', '\0')
const match = regexp.exec(text)
const match = Array.from(text.matchAll(regexp)).pop()
if (!match) {
if (!match || match.input === undefined || match.index === undefined) {
return null
}