Fix username completion deleting characters before it

fixes #421
This commit is contained in:
Nicolas Werner 2021-01-27 20:26:54 +01:00
parent 6c370b1f0e
commit 73244afdb8

View file

@ -206,9 +206,12 @@ Rectangle {
while (pos > -1) { while (pos > -1) {
var t = messageInput.getText(pos, pos + 1); var t = messageInput.getText(pos, pos + 1);
console.log('"' + t + '"'); console.log('"' + t + '"');
if (t == '@' || t == ' ' || t == '\t') { if (t == '@') {
messageInput.openCompleter(pos, "user"); messageInput.openCompleter(pos, "user");
return ; return ;
} else if (t == ' ' || t == '\t') {
messageInput.openCompleter(pos + 1, "user");
return ;
} else if (t == ':') { } else if (t == ':') {
messageInput.openCompleter(pos, "emoji"); messageInput.openCompleter(pos, "emoji");
return ; return ;