From 93884cb89ba25ba35db85ce4e4c9182b889f863e Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 21 Jul 2020 17:50:24 +0100 Subject: [PATCH] Update PlainBasePart to only split on space boundaries Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/editor/parts.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/editor/parts.ts b/src/editor/parts.ts index ed48fcbe4e..f707d8374e 100644 --- a/src/editor/parts.ts +++ b/src/editor/parts.ts @@ -186,7 +186,11 @@ abstract class PlainBasePart extends BasePart { } // when not pasting or dropping text, reject characters that should start a pill candidate if (inputType !== "insertFromPaste" && inputType !== "insertFromDrop") { - return chr !== "@" && chr !== "#" && chr !== ":"; + if (chr !== "@" && chr !== "#" && chr !== ":") { + return true; + } + // only split if the previous character is a space + return this._text[offset - 1] !== " "; } return true; }