mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-19 00:53:42 -05:00
Replace eof action with cancel (#289)
This commit is contained in:
@@ -501,8 +501,8 @@ func parseKeymap(keymap map[int]actionType, execmap map[int]string, toggleSort b
|
||||
keymap[key] = actDeleteCharEof
|
||||
case "end-of-line":
|
||||
keymap[key] = actEndOfLine
|
||||
case "eof":
|
||||
keymap[key] = actEof
|
||||
case "cancel":
|
||||
keymap[key] = actCancel
|
||||
case "forward-char":
|
||||
keymap[key] = actForwardChar
|
||||
case "forward-word":
|
||||
|
||||
@@ -100,11 +100,11 @@ const (
|
||||
actBackwardChar
|
||||
actBackwardDeleteChar
|
||||
actBackwardWord
|
||||
actCancel
|
||||
actClearScreen
|
||||
actDeleteChar
|
||||
actDeleteCharEof
|
||||
actEndOfLine
|
||||
actEof
|
||||
actForwardChar
|
||||
actForwardWord
|
||||
actKillLine
|
||||
@@ -817,9 +817,13 @@ func (t *Terminal) Loop() {
|
||||
}
|
||||
case actEndOfLine:
|
||||
t.cx = len(t.input)
|
||||
case actEof:
|
||||
case actCancel:
|
||||
if len(t.input) == 0 {
|
||||
req(reqQuit)
|
||||
} else {
|
||||
t.yanked = t.input
|
||||
t.input = []rune{}
|
||||
t.cx = 0
|
||||
}
|
||||
case actForwardChar:
|
||||
if t.cx < len(t.input) {
|
||||
|
||||
Reference in New Issue
Block a user