Add clear-query and clear-selection

Close #1787
Related #1364
This commit is contained in:
Junegunn Choi
2019-12-07 14:44:24 +09:00
parent 86e3994e87
commit af1a5f130b
5 changed files with 45 additions and 4 deletions

View File

@@ -185,6 +185,8 @@ const (
actBackwardWord
actCancel
actClearScreen
actClearQuery
actClearSelection
actDeleteChar
actDeleteCharEOF
actEndOfLine
@@ -1905,6 +1907,15 @@ func (t *Terminal) Loop() {
}
case actClearScreen:
req(reqRedraw)
case actClearQuery:
t.input = []rune{}
t.cx = 0
case actClearSelection:
if t.multi > 0 {
t.selected = make(map[int32]selectedItem)
t.version++
req(reqList, reqInfo)
}
case actTop:
t.vset(0)
req(reqList)