mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-24 21:57:36 +00:00
Add preview-half-page-down and preview-half-page-up (#2145)
This commit is contained in:
parent
825d401403
commit
c0aa5a438f
@ -13,6 +13,9 @@ CHANGELOG
|
||||
- Added `--preview-window` option for sharp edges (`--preview-window sharp`)
|
||||
- Reduced vertical padding around the preview window when `--preview-window
|
||||
noborder` is used
|
||||
- Added actions for preview window
|
||||
- `preview-half-page-up`
|
||||
- `preview-half-page-down`
|
||||
- Vim
|
||||
- Popup width and height can be given in absolute integer values
|
||||
- Added `fzf#exec()` function for getting the path of fzf executable
|
||||
|
@ -718,6 +718,8 @@ A key or an event can be bound to one or more of the following actions.
|
||||
\fBpreview-up\fR \fIshift-up\fR
|
||||
\fBpreview-page-down\fR
|
||||
\fBpreview-page-up\fR
|
||||
\fBpreview-half-page-down\fR
|
||||
\fBpreview-half-page-up\fR
|
||||
\fBprevious-history\fR (\fIctrl-p\fR on \fB--history\fR)
|
||||
\fBprint-query\fR (print query and exit)
|
||||
\fBrefresh-preview\fR
|
||||
|
@ -854,6 +854,10 @@ func parseKeymap(keymap map[int][]action, str string) {
|
||||
appendAction(actPreviewPageUp)
|
||||
case "preview-page-down":
|
||||
appendAction(actPreviewPageDown)
|
||||
case "preview-half-page-up":
|
||||
appendAction(actPreviewHalfPageUp)
|
||||
case "preview-half-page-down":
|
||||
appendAction(actPreviewHalfPageDown)
|
||||
default:
|
||||
t := isExecuteAction(specLower)
|
||||
if t == actIgnore {
|
||||
|
@ -236,6 +236,8 @@ const (
|
||||
actPreviewDown
|
||||
actPreviewPageUp
|
||||
actPreviewPageDown
|
||||
actPreviewHalfPageUp
|
||||
actPreviewHalfPageDown
|
||||
actPreviousHistory
|
||||
actNextHistory
|
||||
actExecute
|
||||
@ -1953,6 +1955,14 @@ func (t *Terminal) Loop() {
|
||||
if t.hasPreviewWindow() {
|
||||
scrollPreview(t.pwindow.Height())
|
||||
}
|
||||
case actPreviewHalfPageUp:
|
||||
if t.hasPreviewWindow() {
|
||||
scrollPreview(-t.pwindow.Height()/2)
|
||||
}
|
||||
case actPreviewHalfPageDown:
|
||||
if t.hasPreviewWindow() {
|
||||
scrollPreview(t.pwindow.Height()/2)
|
||||
}
|
||||
case actBeginningOfLine:
|
||||
t.cx = 0
|
||||
case actBackwardChar:
|
||||
|
Loading…
Reference in New Issue
Block a user