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
7dbbbef5
Unverified
Commit
7dbbbef5
authored
7 years ago
by
Junegunn Choi
Browse files
Options
Downloads
Patches
Plain Diff
Add support for alt-{up,down,left,right} keys
Close #1234
parent
7add7512
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
man/man1/fzf.1
+5
-1
5 additions, 1 deletion
man/man1/fzf.1
src/options.go
+8
-0
8 additions, 0 deletions
src/options.go
src/tui/light.go
+18
-0
18 additions, 0 deletions
src/tui/light.go
src/tui/tcell.go
+12
-0
12 additions, 0 deletions
src/tui/tcell.go
src/tui/tui.go
+5
-0
5 additions, 0 deletions
src/tui/tui.go
with
48 additions
and
1 deletion
man/man1/fzf.1
+
5
−
1
View file @
7dbbbef5
...
...
@@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
..
.TH fzf 1 "
Feb
2018" "fzf 0.17.4-devel" "fzf - a command-line fuzzy finder"
.TH fzf 1 "
Apr
2018" "fzf 0.17.4-devel" "fzf - a command-line fuzzy finder"
.SH NAME
fzf - a command-line fuzzy finder
...
...
@@ -464,6 +464,10 @@ e.g. \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR
\fIenter\fR (\fIreturn\fR \fIctrl-m\fR)
\fIspace\fR
\fIbspace\fR (\fIbs\fR)
\fIalt-up\fR
\fIalt-down\fR
\fIalt-left\fR
\fIalt-right\fR
\fIalt-enter\fR
\fIalt-space\fR
\fIalt-bspace\fR (\fIalt-bs\fR)
...
...
This diff is collapsed.
Click to expand it.
src/options.go
+
8
−
0
View file @
7dbbbef5
...
...
@@ -410,6 +410,14 @@ func parseKeyChords(str string, message string) map[int]string {
chord
=
tui
.
AltSlash
case
"alt-bs"
,
"alt-bspace"
:
chord
=
tui
.
AltBS
case
"alt-up"
:
chord
=
tui
.
AltUp
case
"alt-down"
:
chord
=
tui
.
AltDown
case
"alt-left"
:
chord
=
tui
.
AltLeft
case
"alt-right"
:
chord
=
tui
.
AltRight
case
"tab"
:
chord
=
tui
.
Tab
case
"btab"
,
"shift-tab"
:
...
...
This diff is collapsed.
Click to expand it.
src/tui/light.go
+
18
−
0
View file @
7dbbbef5
...
...
@@ -360,6 +360,11 @@ func (r *LightRenderer) escSequence(sz *int) Event {
if
r
.
buffer
[
1
]
>=
1
&&
r
.
buffer
[
1
]
<=
'z'
-
'a'
+
1
{
return
Event
{
int
(
CtrlAltA
+
r
.
buffer
[
1
]
-
1
),
0
,
nil
}
}
alt
:=
false
if
len
(
r
.
buffer
)
>
2
&&
r
.
buffer
[
1
]
==
ESC
{
r
.
buffer
=
r
.
buffer
[
1
:
]
alt
=
true
}
switch
r
.
buffer
[
1
]
{
case
32
:
return
Event
{
AltSpace
,
0
,
nil
}
...
...
@@ -380,12 +385,25 @@ func (r *LightRenderer) escSequence(sz *int) Event {
*
sz
=
3
switch
r
.
buffer
[
2
]
{
case
68
:
if
alt
{
return
Event
{
AltLeft
,
0
,
nil
}
}
return
Event
{
Left
,
0
,
nil
}
case
67
:
if
alt
{
// Ugh..
return
Event
{
AltRight
,
0
,
nil
}
}
return
Event
{
Right
,
0
,
nil
}
case
66
:
if
alt
{
return
Event
{
AltDown
,
0
,
nil
}
}
return
Event
{
Down
,
0
,
nil
}
case
65
:
if
alt
{
return
Event
{
AltUp
,
0
,
nil
}
}
return
Event
{
Up
,
0
,
nil
}
case
90
:
return
Event
{
BTab
,
0
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
src/tui/tcell.go
+
12
−
0
View file @
7dbbbef5
...
...
@@ -295,12 +295,24 @@ func (r *FullscreenRenderer) GetChar() Event {
return
Event
{
BSpace
,
0
,
nil
}
case
tcell
.
KeyUp
:
if
alt
{
return
Event
{
AltUp
,
0
,
nil
}
}
return
Event
{
Up
,
0
,
nil
}
case
tcell
.
KeyDown
:
if
alt
{
return
Event
{
AltDown
,
0
,
nil
}
}
return
Event
{
Down
,
0
,
nil
}
case
tcell
.
KeyLeft
:
if
alt
{
return
Event
{
AltLeft
,
0
,
nil
}
}
return
Event
{
Left
,
0
,
nil
}
case
tcell
.
KeyRight
:
if
alt
{
return
Event
{
AltRight
,
0
,
nil
}
}
return
Event
{
Right
,
0
,
nil
}
case
tcell
.
KeyHome
:
...
...
This diff is collapsed.
Click to expand it.
src/tui/tui.go
+
5
−
0
View file @
7dbbbef5
...
...
@@ -85,6 +85,11 @@ const (
AltSlash
AltBS
AltUp
AltDown
AltLeft
AltRight
Alt0
)
...
...
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