Add toggle-preview-wrap action

This commit is contained in:
Junegunn Choi 2017-02-18 23:49:00 +09:00
parent 309e1d8619
commit c82fb3c9b9
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
5 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,11 @@
CHANGELOG
=========
0.16.5
------
- Minor bug fixes
- Added `toggle-preview-wrap` action
0.16.4
------
- Added `--border` option to draw border above and below the finder

View File

@ -500,6 +500,7 @@ e.g. \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR
\fBtoggle-in\fR (\fB--reverse\fR ? \fBtoggle+up\fR : \fBtoggle+down\fR)
\fBtoggle-out\fR (\fB--reverse\fR ? \fBtoggle+down\fR : \fBtoggle+up\fR)
\fBtoggle-preview\fR
\fBtoggle-preview-wrap\fR
\fBtoggle-sort\fR
\fBtoggle+up\fR \fIbtab (shift-tab)\fR
\fBunix-line-discard\fR \fIctrl-u\fR

View File

@ -723,6 +723,8 @@ func parseKeymap(keymap map[int][]action, str string) {
appendAction(actNextHistory)
case "toggle-preview":
appendAction(actTogglePreview)
case "toggle-preview-wrap":
appendAction(actTogglePreviewWrap)
case "toggle-sort":
appendAction(actToggleSort)
case "preview-up":

View File

@ -199,6 +199,7 @@ const (
actPrintQuery
actToggleSort
actTogglePreview
actTogglePreviewWrap
actPreviewUp
actPreviewDown
actPreviewPageUp
@ -1459,6 +1460,11 @@ func (t *Terminal) Loop() {
}
req(reqList, reqInfo, reqHeader)
}
case actTogglePreviewWrap:
if t.hasPreviewWindow() {
t.preview.wrap = !t.preview.wrap
req(reqPreviewRefresh)
}
case actToggleSort:
t.sort = !t.sort
t.eventBox.Set(EvtSearchNew, t.sort)

View File

@ -596,7 +596,7 @@ func (r *LightRenderer) MaxY() int {
}
func (r *LightRenderer) DoesAutoWrap() bool {
return true
return false
}
func (r *LightRenderer) IsOptimized() bool {