diff options
-rw-r--r-- | resources/qml/MessageInput.qml | 2 | ||||
-rw-r--r-- | src/CompletionProxyModel.h | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index d9592e14..1366689c 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml @@ -129,7 +129,7 @@ Rectangle { event.accepted = true; } if (popup.opened) - popup.completer.setSearchString(textArea.getText(completerTriggeredAt, cursorPosition)); + popup.completer.setSearchString(textArea.getText(completerTriggeredAt, cursorPosition) + event.text); } diff --git a/src/CompletionProxyModel.h b/src/CompletionProxyModel.h index ee8236e3..2bc22875 100644 --- a/src/CompletionProxyModel.h +++ b/src/CompletionProxyModel.h @@ -90,27 +90,27 @@ public: sourceModel()->data(source_left, CompletionModel::SearchRole).toString(); auto left2 = sourceModel()->data(source_left, CompletionModel::SearchRole2).toString(); - auto left = left1.toLower().indexOf(searchString); + auto left = (size_t)left1.toLower().indexOf(searchString); // utils::levenshtein_distance(searchString, left1.toLower().toStdString()); if (!left2.isEmpty()) { // left = std::min( // utils::levenshtein_distance(searchString, // left2.toLower().toStdString()), left); - left = std::min(left2.toLower().indexOf(searchString), left); + left = std::min((size_t)left2.toLower().indexOf(searchString), left); } auto right1 = sourceModel()->data(source_right, CompletionModel::SearchRole).toString(); auto right2 = sourceModel()->data(source_right, CompletionModel::SearchRole2).toString(); - auto right = right1.toLower().indexOf(searchString); + auto right = (size_t)right1.toLower().indexOf(searchString); // auto right = // utils::levenshtein_distance(searchString, right1.toLower().toStdString()); if (!right2.isEmpty()) { // right = std::min( // utils::levenshtein_distance(searchString, // right2.toLower().toStdString()), right); - right = std::min(right2.toLower().indexOf(searchString), right); + right = std::min((size_t)right2.toLower().indexOf(searchString), right); } return left < right; |