mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 15:53:39 -05:00
Add preview-half-page-down and preview-half-page-up (#2145)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user