Skip to content

Commit

Permalink
fix: unbreak suggestions for emojis containing an underscore
Browse files Browse the repository at this point in the history
- don't consider `_` as a "punct" or invalid character, some emojis like
flags do contain it in their name

Fixes: #8446
  • Loading branch information
caybro committed Nov 25, 2022
1 parent a46206e commit c12a84f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/imports/shared/status/StatusChatInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions ui/imports/utils/Utils.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}

0 comments on commit c12a84f

Please sign in to comment.