fix: unbreak suggestions for emojis containing an underscore

- don't consider `_` as a "punct" or invalid character, some emojis like
flags do contain it in their name

Fixes: #8446
This commit is contained in:
Lukáš Tinkl 2022-11-25 14:29:12 +01:00 committed by Lukáš Tinkl
parent 48b2b978e4
commit 6b7eea8db9
2 changed files with 2 additions and 3 deletions

View File

@ -796,7 +796,7 @@ Rectangle {
function validSubstr(substr) {
for(var i = 0; i < substr.length; i++) {
var c = substr.charAt(i);
if (Utils.isSpace(c) === true || Utils.isPunct(c) === true)
if (Utils.isSpace(c) || Utils.isPunct(c))
return false;
}
return true;

View File

@ -755,7 +755,6 @@ QtObject {
// Leave this function at the bottom of the file as QT Creator messes up the code color after this
function isPunct(c) {
return /(!|\@|#|\$|%|\^|&|\*|\(|\)|_|\+|\||-|=|\\|{|}|[|]|"|;|'|<|>|\?|,|\.|\/)/.test(c)
return /(!|\@|#|\$|%|\^|&|\*|\(|\)|\+|\||-|=|\\|{|}|[|]|"|;|'|<|>|\?|,|\.|\/)/.test(c)
}
}