mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-14 11:45:48 -07:00
Add "eof" action which closes the finder only when input is empty
Close #289
This commit is contained in:
@@ -103,6 +103,7 @@ const (
|
||||
actClearScreen
|
||||
actDeleteChar
|
||||
actEndOfLine
|
||||
actEof
|
||||
actForwardChar
|
||||
actForwardWord
|
||||
actKillLine
|
||||
@@ -813,6 +814,10 @@ func (t *Terminal) Loop() {
|
||||
}
|
||||
case actEndOfLine:
|
||||
t.cx = len(t.input)
|
||||
case actEof:
|
||||
if len(t.input) == 0 {
|
||||
req(reqQuit)
|
||||
}
|
||||
case actForwardChar:
|
||||
if t.cx < len(t.input) {
|
||||
t.cx++
|
||||
|
Reference in New Issue
Block a user