Aevann 2024-01-16 08:21:22 +02:00
parent 17e25ebdfb
commit 0c08e5d7bb
1 changed files with 2 additions and 6 deletions

View File

@ -136,12 +136,8 @@ function update_inline_emoji_modal(event)
// Get current word at string, such as ":marse" or "word"
let coords = text.indexOf(' ',box_coords.pos);
current_word = /(^|\s):[!#a-zA-Z0-9_]+(?=\n|$)/.exec(text.slice(0, coords === -1 ? text.length : coords));
if (current_word) {
current_word = current_word[0].toLowerCase();
if (current_word.startsWith(' :'))
current_word = current_word.substring(1)
}
current_word = /(^|\s)(:[!#a-zA-Z0-9_]+(?=\n|$))/.exec(text.slice(0, coords === -1 ? text.length : coords));
if (current_word) current_word = current_word[2].toLowerCase();
/* We could also check emoji_typing_state here, which is less accurate but more efficient. I've
* kept it unless someone wants to provide an option to toggle it for performance */