[Glitch] Improve emoji search

Port cf46401689 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo authored and Tarrien committed 2026-08-14 07:27:21 -04:00
1 parent 449aa77337
commit 852a08ab36
10 files changed
+639 -328

No files matched your search

@@ -10,6 +10,14 @@ describe('textAtCursorMatchesToken', () => {
['#hash tag', 8, ['#']],
[1, '#hash tag'],
],
[
[':+1', 2, [':']],
[1, ':+1'],
],
[
[':-1', 2, [':']],
[1, ':-1'],
],
[
['#ハッシュタグ', 6, ['#']],
[1, '#ハッシュタグ'],
@@ -8,7 +8,7 @@ export const textAtCursorMatchesToken = (
let word: string;
const regex = new RegExp(
`[${searchTokens.join('')}${WORD}]+(\\s[${WORD}]+)?$`,
`[${searchTokens.join('')}${WORD}+-]+(\\s[${WORD}]+)?$`,
'iu',
);
const left = str.slice(0, caretPosition).search(regex);