mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-10 18:24:39 +00:00
parent
a0d61b4c37
commit
391aa14845
16
CHANGELOG.md
16
CHANGELOG.md
@ -39,6 +39,22 @@ CHANGELOG
|
|||||||
curl localhost:6266 -H "x-api-key: $FZF_API_KEY" -d 'change-query(yo)'
|
curl localhost:6266 -H "x-api-key: $FZF_API_KEY" -d 'change-query(yo)'
|
||||||
```
|
```
|
||||||
- Added `toggle-header` action
|
- Added `toggle-header` action
|
||||||
|
- Added mouse events for `--bind`
|
||||||
|
- `scroll-up` (bound to `up`)
|
||||||
|
- `scroll-down` (bound to `down`)
|
||||||
|
- `shift-scroll-up` (bound to `toggle+up`)
|
||||||
|
- `shift-scroll-down` (bound to `toggle+down`)
|
||||||
|
- `shift-left-click` (bound to `toggle`)
|
||||||
|
- `shift-right-click` (bound to `toggle`)
|
||||||
|
- `preview-scroll-up` (bound to `preview-up`)
|
||||||
|
- `preview-scroll-down` (bound to `preview-down`)
|
||||||
|
```sh
|
||||||
|
# Twice faster scrolling both in the main window and the preview window
|
||||||
|
fzf --bind 'scroll-up:up+up,scroll-down:down+down' \
|
||||||
|
--bind 'preview-scroll-up:preview-up+preview-up' \
|
||||||
|
--bind 'preview-scroll-down:preview-down+preview-down' \
|
||||||
|
--preview 'cat {}'
|
||||||
|
```
|
||||||
- Shell extensions
|
- Shell extensions
|
||||||
- bash key bindings no longer requires perl; it will use awk or mawk
|
- bash key bindings no longer requires perl; it will use awk or mawk
|
||||||
instead if perl is not found
|
instead if perl is not found
|
||||||
|
@ -1012,6 +1012,22 @@ e.g.
|
|||||||
.br
|
.br
|
||||||
\fIdouble-click\fR
|
\fIdouble-click\fR
|
||||||
.br
|
.br
|
||||||
|
\fIscroll-up\fR
|
||||||
|
.br
|
||||||
|
\fIscroll-down\fR
|
||||||
|
.br
|
||||||
|
\fIpreview-scroll-up\fR
|
||||||
|
.br
|
||||||
|
\fIpreview-scroll-down\fR
|
||||||
|
.br
|
||||||
|
\fIshift-left-click\fR
|
||||||
|
.br
|
||||||
|
\fIshift-right-click\fR
|
||||||
|
.br
|
||||||
|
\fIshift-scroll-up\fR
|
||||||
|
.br
|
||||||
|
\fIshift-scroll-down\fR
|
||||||
|
.br
|
||||||
or any single character
|
or any single character
|
||||||
|
|
||||||
.SS AVAILABLE EVENTS:
|
.SS AVAILABLE EVENTS:
|
||||||
|
@ -702,8 +702,24 @@ func parseKeyChordsImpl(str string, message string, exit func(string)) map[tui.E
|
|||||||
add(tui.LeftClick)
|
add(tui.LeftClick)
|
||||||
case "right-click":
|
case "right-click":
|
||||||
add(tui.RightClick)
|
add(tui.RightClick)
|
||||||
|
case "shift-left-click":
|
||||||
|
add(tui.SLeftClick)
|
||||||
|
case "shift-right-click":
|
||||||
|
add(tui.SRightClick)
|
||||||
case "double-click":
|
case "double-click":
|
||||||
add(tui.DoubleClick)
|
add(tui.DoubleClick)
|
||||||
|
case "scroll-up":
|
||||||
|
add(tui.ScrollUp)
|
||||||
|
case "scroll-down":
|
||||||
|
add(tui.ScrollDown)
|
||||||
|
case "shift-scroll-up":
|
||||||
|
add(tui.SScrollUp)
|
||||||
|
case "shift-scroll-down":
|
||||||
|
add(tui.SScrollDown)
|
||||||
|
case "preview-scroll-up":
|
||||||
|
add(tui.PreviewScrollUp)
|
||||||
|
case "preview-scroll-down":
|
||||||
|
add(tui.PreviewScrollDown)
|
||||||
case "f10":
|
case "f10":
|
||||||
add(tui.F10)
|
add(tui.F10)
|
||||||
case "f11":
|
case "f11":
|
||||||
|
@ -525,6 +525,16 @@ func defaultKeymap() map[tui.Event][]*action {
|
|||||||
add(tui.Mouse, actMouse)
|
add(tui.Mouse, actMouse)
|
||||||
add(tui.LeftClick, actIgnore)
|
add(tui.LeftClick, actIgnore)
|
||||||
add(tui.RightClick, actToggle)
|
add(tui.RightClick, actToggle)
|
||||||
|
add(tui.SLeftClick, actToggle)
|
||||||
|
add(tui.SRightClick, actToggle)
|
||||||
|
|
||||||
|
add(tui.ScrollUp, actUp)
|
||||||
|
add(tui.ScrollDown, actDown)
|
||||||
|
keymap[tui.SScrollUp.AsEvent()] = toActions(actToggle, actUp)
|
||||||
|
keymap[tui.SScrollDown.AsEvent()] = toActions(actToggle, actDown)
|
||||||
|
|
||||||
|
add(tui.PreviewScrollUp, actPreviewUp)
|
||||||
|
add(tui.PreviewScrollDown, actPreviewDown)
|
||||||
return keymap
|
return keymap
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3483,13 +3493,23 @@ func (t *Terminal) Loop() {
|
|||||||
// Scrolling
|
// Scrolling
|
||||||
if me.S != 0 {
|
if me.S != 0 {
|
||||||
if t.window.Enclose(my, mx) && t.merger.Length() > 0 {
|
if t.window.Enclose(my, mx) && t.merger.Length() > 0 {
|
||||||
if t.multi > 0 && me.Mod {
|
evt := tui.ScrollUp
|
||||||
toggle()
|
if me.Mod {
|
||||||
|
evt = tui.SScrollUp
|
||||||
}
|
}
|
||||||
t.vmove(me.S, true)
|
if me.S < 0 {
|
||||||
req(reqList)
|
evt = tui.ScrollDown
|
||||||
|
if me.Mod {
|
||||||
|
evt = tui.SScrollDown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return doActions(actionsFor(evt))
|
||||||
} else if t.hasPreviewWindow() && t.pwindow.Enclose(my, mx) {
|
} else if t.hasPreviewWindow() && t.pwindow.Enclose(my, mx) {
|
||||||
scrollPreviewBy(-me.S)
|
evt := tui.PreviewScrollUp
|
||||||
|
if me.S < 0 {
|
||||||
|
evt = tui.PreviewScrollDown
|
||||||
|
}
|
||||||
|
return doActions(actionsFor(evt))
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -3580,15 +3600,19 @@ func (t *Terminal) Loop() {
|
|||||||
// Prompt
|
// Prompt
|
||||||
t.cx = mx + t.xoffset
|
t.cx = mx + t.xoffset
|
||||||
} else if my >= min {
|
} else if my >= min {
|
||||||
// List
|
t.vset(t.offset + my - min)
|
||||||
if t.vset(t.offset+my-min) && t.multi > 0 && me.Mod {
|
|
||||||
toggle()
|
|
||||||
}
|
|
||||||
req(reqList)
|
req(reqList)
|
||||||
if me.Left {
|
evt := tui.RightClick
|
||||||
return doActions(actionsFor(tui.LeftClick))
|
if me.Mod {
|
||||||
|
evt = tui.SRightClick
|
||||||
}
|
}
|
||||||
return doActions(actionsFor(tui.RightClick))
|
if me.Left {
|
||||||
|
evt = tui.LeftClick
|
||||||
|
if me.Mod {
|
||||||
|
evt = tui.SLeftClick
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return doActions(actionsFor(evt))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case actReload, actReloadSync:
|
case actReload, actReloadSync:
|
||||||
|
@ -55,6 +55,14 @@ const (
|
|||||||
DoubleClick
|
DoubleClick
|
||||||
LeftClick
|
LeftClick
|
||||||
RightClick
|
RightClick
|
||||||
|
SLeftClick
|
||||||
|
SRightClick
|
||||||
|
ScrollUp
|
||||||
|
ScrollDown
|
||||||
|
SScrollUp
|
||||||
|
SScrollDown
|
||||||
|
PreviewScrollUp
|
||||||
|
PreviewScrollDown
|
||||||
|
|
||||||
BTab
|
BTab
|
||||||
BSpace
|
BSpace
|
||||||
|
Loading…
Reference in New Issue
Block a user