Add change-query(...) action

This commit is contained in:
Junegunn Choi
2022-12-17 18:59:16 +09:00
parent a3b6b03dfb
commit 51c518da1e
5 changed files with 21 additions and 1 deletions

View File

@@ -266,6 +266,7 @@ const (
actBackwardWord
actCancel
actChangePrompt
actChangeQuery
actClearScreen
actClearQuery
actClearSelection
@@ -2647,6 +2648,9 @@ func (t *Terminal) Loop() {
}
case actPrintQuery:
req(reqPrintQuery)
case actChangeQuery:
t.input = []rune(a.a)
t.cx = len(t.input)
case actChangePrompt:
t.prompt, t.promptLen = t.parsePrompt(a.a)
req(reqPrompt)