diff --git a/gui/main.qml b/gui/main.qml index 4bb631d..30b7b04 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -137,8 +137,8 @@ ApplicationWindow { if (_acMatches.length > 0) { var lcp = acLCP(_acMatches) if (lcp.length > prefix.length) { - text = _acBase + lcp - cursorPosition = text.length + promptInput.text = _acBase + lcp + promptInput.cursorPosition = promptInput.text.length } } else { // No options — transition to done immediately @@ -152,16 +152,16 @@ ApplicationWindow { function acCycle() { if (!_acActive || _acMatches.length <= 1) return _acMatchIndex = (_acMatchIndex + 1) % _acMatches.length - var parts = text.substring(text.lastIndexOf("/") + 1).split(" ") + var parts = promptInput.text.substring(promptInput.text.lastIndexOf("/") + 1).split(" ") parts[0] = _acMatches[_acMatchIndex] - text = _acBase + "/" + parts.join(" ") - cursorPosition = text.length + promptInput.text = _acBase + "/" + parts.join(" ") + promptInput.cursorPosition = promptInput.text.length } function acCancel() { if (!_acActive) return - text = _acBase + _acTyped - cursorPosition = text.length + promptInput.text = _acBase + _acTyped + promptInput.cursorPosition = promptInput.text.length _acActive = false _acBase = "" _acTyped = ""