fix: Fix multi character suggest (#1620)

This commit is contained in:
Flávio Carvalho 2021-07-26 14:39:08 +01:00 committed by GitHub
parent 45faa1fc7d
commit 83a53c16db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,10 @@ export function findSuggestionMatch(config: Trigger): SuggestionMatch {
} = config
// Matching expressions used for later
const escapedChar = `\\${char}`
const escapedChar = char
.split('')
.map(c => `\\${c}`)
.join('')
const suffix = new RegExp(`\\s${escapedChar}$`)
const prefix = startOfLine ? '^' : ''
const regexp = allowSpaces