forked from rDrama/rDrama
1
0
Fork 0

remove unnecessary popups when adding # or ! to emoji

master
Aevann 2024-05-23 23:50:06 +03:00
parent b6cd61340f
commit 2f20fd1b3c
1 changed files with 4 additions and 4 deletions

View File

@ -137,12 +137,12 @@ function update_inline_emoji_modal(event)
break;
}
text = text.slice(0, event.target.selectionStart)
let coords = text.indexOf(' ', box_coords.pos);
text = text.slice(0, coords === -1 ? text.length : coords)
text = text.split('\n').slice(-1)
// Get current word at string, such as ":marse" or "word"
let coords = text.indexOf(' ', box_coords.pos);
current_word = /(^|\s|\+|-)([:!@][!#\w-]{2,}(?=\n|$))/.exec(text.slice(0, coords === -1 ? text.length : coords));
current_word = /(^|\s|\+|-)([:!@][!#\w-]{2,}(?=\n|$))/.exec(text);
if (current_word) {
current_word = current_word[2].toLowerCase();