Add change-prompt action

Close #2270
This commit is contained in:
Junegunn Choi
2020-12-04 20:34:41 +09:00
parent d2af3ff98d
commit 6d647e13ff
6 changed files with 65 additions and 28 deletions

View File

@@ -214,6 +214,7 @@ const (
actBackwardDeleteCharEOF
actBackwardWord
actCancel
actChangePrompt
actClearScreen
actClearQuery
actClearSelection
@@ -2223,6 +2224,9 @@ func (t *Terminal) Loop() {
}
case actPrintQuery:
req(reqPrintQuery)
case actChangePrompt:
t.prompt, t.promptLen = t.parsePrompt(a.a)
req(reqPrompt)
case actPreview:
togglePreview(true)
refreshPreview(a.a)