Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9ac5f4d

Browse files
authored
Merge pull request #5754 from panoschal/fix/pills-selection-bug
Allow pills on the beginning of a part string
2 parents 229a95f + a1eabde commit 9ac5f4d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/editor/parts.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ abstract class PlainBasePart extends BasePart {
189189
if (chr !== "@" && chr !== "#" && chr !== ":" && chr !== "+") {
190190
return true;
191191
}
192-
// only split if the previous character is a space
192+
193+
// split if we are at the beginning of the part text
194+
if (offset === 0) {
195+
return false;
196+
}
197+
198+
// or split if the previous character is a space
193199
// or if it is a + and this is a :
194200
return this._text[offset - 1] !== " " &&
195201
(this._text[offset - 1] !== "+" || chr !== ":");

0 commit comments

Comments
 (0)