First working autocomplete.

This commit is contained in:
Black Hat 2018-10-23 11:51:46 +08:00
parent 98b99e49f2
commit 41107bc99b
1 changed files with 4 additions and 2 deletions

View File

@ -41,7 +41,7 @@ Rectangle {
id: userAutoComplete id: userAutoComplete
visible: isAutoCompleting visible: isAutoCompleting && autoCompleteModel.length !== 0
contentItem: ListView { contentItem: ListView {
id: userAutoCompleteListView id: userAutoCompleteListView
@ -213,7 +213,9 @@ Rectangle {
repeatTimer.start() repeatTimer.start()
currentRoom.cachedInput = text currentRoom.cachedInput = text
if (cursorPosition < autoCompleteBeginPosition || cursorPosition > autoCompleteEndPosition) isAutoCompleting = false if (cursorPosition !== autoCompleteBeginPosition && cursorPosition !== autoCompleteEndPosition) {
isAutoCompleting = false
}
} }
function postMessage(text) { function postMessage(text) {