Add accept-or-print-query

Close #3528
This commit is contained in:
Junegunn Choi
2023-12-10 15:59:45 +09:00
parent a343b20775
commit c36a64be68
5 changed files with 49 additions and 0 deletions

View File

@@ -343,6 +343,7 @@ const (
actAbort
actAccept
actAcceptNonEmpty
actAcceptOrPrintQuery
actBackwardChar
actBackwardDeleteChar
actBackwardDeleteCharEOF
@@ -3497,6 +3498,12 @@ func (t *Terminal) Loop() {
if len(t.selected) > 0 || t.merger.Length() > 0 || !t.reading && t.count == 0 {
req(reqClose)
}
case actAcceptOrPrintQuery:
if len(t.selected) > 0 || t.merger.Length() > 0 {
req(reqClose)
} else {
req(reqPrintQuery)
}
case actClearScreen:
req(reqFullRedraw)
case actClearQuery: