m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 08:13:40 -05:00

Add close action

Close #2331
This commit is contained in:
Junegunn Choi
2021-02-02 00:08:54 +09:00
parent d110372f99
commit f55c990e86
6 changed files with 30 additions and 2 deletions

View File

@@ -883,6 +883,8 @@ func parseKeymap(keymap map[tui.Event][]action, str string) {
appendAction(actSelectAll)
case "deselect-all":
appendAction(actDeselectAll)
case "close":
appendAction(actClose)
case "toggle":
appendAction(actToggle)
case "down":

View File

@@ -221,6 +221,7 @@ const (
actClearScreen
actClearQuery
actClearSelection
actClose
actDeleteChar
actDeleteCharEOF
actEndOfLine
@@ -2334,6 +2335,12 @@ func (t *Terminal) Loop() {
}
req(reqList, reqInfo)
}
case actClose:
if t.isPreviewEnabled() {
togglePreview(false)
} else {
req(reqQuit)
}
case actToggle:
if t.multi > 0 && t.merger.Length() > 0 && toggle() {
req(reqList)