Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fzf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
fzf
Commits
fdbf3d3f
Commit
fdbf3d3f
authored
9 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
Replace eof action with cancel (#289)
parent
f9136cff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CHANGELOG.md
+3
-2
3 additions, 2 deletions
CHANGELOG.md
man/man1/fzf.1
+1
-1
1 addition, 1 deletion
man/man1/fzf.1
src/options.go
+2
-2
2 additions, 2 deletions
src/options.go
src/terminal.go
+6
-2
6 additions, 2 deletions
src/terminal.go
test/test_go.rb
+7
-7
7 additions, 7 deletions
test/test_go.rb
with
19 additions
and
14 deletions
CHANGELOG.md
+
3
−
2
View file @
fdbf3d3f
...
...
@@ -9,8 +9,9 @@ CHANGELOG
-
Added options for sticky header
-
`--header-file`
-
`--header-lines`
-
Added
`eof`
action which closes the finder only when the input is empty
-
e.g.
`export FZF_DEFAULT_OPTS="--bind esc:eof"`
-
Added
`cancel`
action which clears the input or closes the finder when the
input is already empty
-
e.g.
`export FZF_DEFAULT_OPTS="--bind esc:cancel"`
-
Added
`delete-char/eof`
action to differentiate
`CTRL-D`
and
`DEL`
### Minor improvements/fixes
...
...
This diff is collapsed.
Click to expand it.
man/man1/fzf.1
+
1
−
1
View file @
fdbf3d3f
...
...
@@ -188,13 +188,13 @@ e.g. \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR
\fBbackward-kill-word\fR \fIalt-bs\fR
\fBbackward-word\fR \fIalt-b shift-left\fR
\fBbeginning-of-line\fR \fIctrl-a home\fR
\fBcancel\fR
\fBclear-screen\fR \fIctrl-l\fR
\fBdelete-char\fR \fIdel\fR
\fBdelete-char/eof\fR \fIctrl-d\fR
\fBdeselect-all\fR
\fBdown\fR \fIctrl-j ctrl-n down\fR
\fBend-of-line\fR \fIctrl-e end\fR
\fBeof\fR
\fBexecute(...)\fR (see below for the details)
\fBforward-char\fR \fIctrl-f right\fR
\fBforward-word\fR \fIalt-f shift-right\fR
...
...
This diff is collapsed.
Click to expand it.
src/options.go
+
2
−
2
View file @
fdbf3d3f
...
...
@@ -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
]
=
act
Eof
case
"
cancel
"
:
keymap
[
key
]
=
act
Cancel
case
"forward-char"
:
keymap
[
key
]
=
actForwardChar
case
"forward-word"
:
...
...
This diff is collapsed.
Click to expand it.
src/terminal.go
+
6
−
2
View file @
fdbf3d3f
...
...
@@ -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
act
Eof
:
case
act
Cancel
:
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
)
{
...
...
This diff is collapsed.
Click to expand it.
test/test_go.rb
+
7
−
7
View file @
fdbf3d3f
...
...
@@ -718,14 +718,14 @@ class TestGoFZF < TestBase
end
end
def
test_
eof
tmux
.
send_keys
"seq 10
0
|
#{
fzf
"--bind 2:
eof
"
}
"
,
:Enter
tmux
.
until
{
|
lines
|
lines
[
-
2
].
include?
(
'10
0
/10
0
'
)
}
def
test_
canel
tmux
.
send_keys
"seq 10 |
#{
fzf
"--bind 2:
cancel
"
}
"
,
:Enter
tmux
.
until
{
|
lines
|
lines
[
-
2
].
include?
(
'10/10'
)
}
tmux
.
send_keys
'123'
tmux
.
until
do
|
lines
|
lines
[
-
1
]
==
'> 13'
&&
lines
[
-
2
].
include?
(
'1/100'
)
end
tmux
.
send_keys
:BSpace
,
:BSpace
tmux
.
until
{
|
lines
|
lines
[
-
1
]
==
'> 3'
&&
lines
[
-
2
].
include?
(
'1/10'
)
}
tmux
.
send_keys
'C-y'
,
'C-y'
tmux
.
until
{
|
lines
|
lines
[
-
1
]
==
'> 311'
}
tmux
.
send_keys
2
tmux
.
until
{
|
lines
|
lines
[
-
1
]
==
'>'
}
tmux
.
send_keys
2
tmux
.
prepare
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment