mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 08:13:40 -05:00
Truncate long lines in preview window
Add `:wrap` to --preview-window to wrap lines instead Close #756
This commit is contained in:
@@ -273,6 +273,14 @@ func (w *Window) Erase() {
|
||||
C.werase(w.win())
|
||||
}
|
||||
|
||||
func (w *Window) X() int {
|
||||
return int(C.getcurx(w.win()))
|
||||
}
|
||||
|
||||
func DoesAutoWrap() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (w *Window) Fill(str string) bool {
|
||||
return C.waddstr(w.win(), C.CString(str)) == C.OK
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user