fix: use promptInput.text instead of bare text in root-level autocomplete functions

This commit is contained in:
Levi Neely 2026-08-01 13:00:24 +02:00
parent 1d26552675
commit 9bab0e73c2
1 changed files with 7 additions and 7 deletions

View File

@ -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 = ""