Fix emoji autocompletion absorbing non-spaced emojis

This commit is contained in:
Ken Powers 2019-08-20 15:45:25 -04:00 committed by Scott Nonnenberg
parent 5b653b3b46
commit 4d659f69cb

View file

@ -80,7 +80,7 @@ function getWordAtIndex(str: string, index: number) {
.slice(0, index + 1)
.replace(/\s+$/, '')
.search(/\S+$/);
const end = str.slice(index).search(/(?:\s|$)/) + index;
const end = str.slice(index).search(/(?:[^a-z0-9-_+]|$)/) + index;
return {
start,