refactor: use string for command line buffers (#2412)

This commit is contained in:
Joe Lim authored and GitHub committed 2026-03-04 22:24:06 +11:00
1 parent d082410b3d
commit 1afe4ff441
6 files changed
+148 -148

No files matched your search

+3 -3
View File
@@ -684,14 +684,14 @@ func (app *app) doComplete() (matches []compMatch) {
matches, longest = completeSearch(app.ui.cmdAccLeft)
}
app.ui.cmdAccLeft = []rune(longest)
app.ui.cmdAccLeft = longest
app.ui.menu, app.ui.menuSelect = listMatches(app.ui.screen, matches, -1)
return
}
func (app *app) menuComplete(direction int) {
if !app.menuCompActive {
app.menuCompTmp = tokenize(string(app.ui.cmdAccLeft))
app.menuCompTmp = tokenize(app.ui.cmdAccLeft)
app.menuComps = app.doComplete()
if len(app.menuComps) > 1 {
app.menuCompInd = -1
@@ -707,7 +707,7 @@ func (app *app) menuComplete(direction int) {
toks := slices.Clone(app.menuCompTmp)
toks[len(toks)-1] = app.menuComps[app.menuCompInd].result
app.ui.cmdAccLeft = []rune(strings.Join(toks, " "))
app.ui.cmdAccLeft = strings.Join(toks, " ")
}
app.ui.menu, app.ui.menuSelect = listMatches(app.ui.screen, app.menuComps, app.menuCompInd)
}