m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 15:53:39 -05:00

Truncate long lines in preview window

Add `:wrap` to --preview-window to wrap lines instead

Close #756
This commit is contained in:
Junegunn Choi
2016-12-05 02:13:47 +09:00
parent ab9ae4f643
commit a442fe0fd0
5 changed files with 91 additions and 37 deletions

View File

@@ -172,6 +172,14 @@ func (w *Window) win() *WindowTcell {
return (*WindowTcell)(w.impl)
}
func (w *Window) X() int {
return w.impl.LastX
}
func DoesAutoWrap() bool {
return false
}
func Clear() {
_screen.Sync()
_screen.Clear()
@@ -521,7 +529,7 @@ func (w *Window) FillString(text string, pair ColorPair, a Attr) bool {
var xPos = w.Left + w.win().LastX + lx
// word wrap:
if xPos > (w.Left + w.Width) {
if xPos >= (w.Left + w.Width) {
w.win().LastY++
w.win().LastX = 0
lx = 0