m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-15 06:43:47 -05:00

Replace eof action with cancel (#289)

This commit is contained in:
Junegunn Choi
2015-07-23 21:05:33 +09:00
parent f9136cffe6
commit fdbf3d3fec
5 changed files with 19 additions and 14 deletions

View File

@@ -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) {