mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 06:07:42 +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`)
|
- Added `--preview-window` option for sharp edges (`--preview-window sharp`)
|
||||||
- Reduced vertical padding around the preview window when `--preview-window
|
- Reduced vertical padding around the preview window when `--preview-window
|
||||||
noborder` is used
|
noborder` is used
|
||||||
|
- Added actions for preview window
|
||||||
|
- `preview-half-page-up`
|
||||||
|
- `preview-half-page-down`
|
||||||
- Vim
|
- Vim
|
||||||
- Popup width and height can be given in absolute integer values
|
- Popup width and height can be given in absolute integer values
|
||||||
- Added `fzf#exec()` function for getting the path of fzf executable
|
- 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-up\fR \fIshift-up\fR
|
||||||
\fBpreview-page-down\fR
|
\fBpreview-page-down\fR
|
||||||
\fBpreview-page-up\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)
|
\fBprevious-history\fR (\fIctrl-p\fR on \fB--history\fR)
|
||||||
\fBprint-query\fR (print query and exit)
|
\fBprint-query\fR (print query and exit)
|
||||||
\fBrefresh-preview\fR
|
\fBrefresh-preview\fR
|
||||||
|
@ -854,6 +854,10 @@ func parseKeymap(keymap map[int][]action, str string) {
|
|||||||
appendAction(actPreviewPageUp)
|
appendAction(actPreviewPageUp)
|
||||||
case "preview-page-down":
|
case "preview-page-down":
|
||||||
appendAction(actPreviewPageDown)
|
appendAction(actPreviewPageDown)
|
||||||
|
case "preview-half-page-up":
|
||||||
|
appendAction(actPreviewHalfPageUp)
|
||||||
|
case "preview-half-page-down":
|
||||||
|
appendAction(actPreviewHalfPageDown)
|
||||||
default:
|
default:
|
||||||
t := isExecuteAction(specLower)
|
t := isExecuteAction(specLower)
|
||||||
if t == actIgnore {
|
if t == actIgnore {
|
||||||
|
@ -236,6 +236,8 @@ const (
|
|||||||
actPreviewDown
|
actPreviewDown
|
||||||
actPreviewPageUp
|
actPreviewPageUp
|
||||||
actPreviewPageDown
|
actPreviewPageDown
|
||||||
|
actPreviewHalfPageUp
|
||||||
|
actPreviewHalfPageDown
|
||||||
actPreviousHistory
|
actPreviousHistory
|
||||||
actNextHistory
|
actNextHistory
|
||||||
actExecute
|
actExecute
|
||||||
@ -1953,6 +1955,14 @@ func (t *Terminal) Loop() {
|
|||||||
if t.hasPreviewWindow() {
|
if t.hasPreviewWindow() {
|
||||||
scrollPreview(t.pwindow.Height())
|
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:
|
case actBeginningOfLine:
|
||||||
t.cx = 0
|
t.cx = 0
|
||||||
case actBackwardChar:
|
case actBackwardChar:
|
||||||
|
Loading…
Reference in New Issue
Block a user