mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-23 23:28:31 +00:00
Fix preview window of tcell renderer
This commit is contained in:
parent
11841f688b
commit
9b946f2b7a
@ -515,8 +515,9 @@ func (w *TcellWindow) CPrint(pair ColorPair, text string) {
|
|||||||
w.printString(text, pair)
|
w.printString(text, pair)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *TcellWindow) fillString(text string, pair ColorPair, a Attr) FillReturn {
|
func (w *TcellWindow) fillString(text string, pair ColorPair) FillReturn {
|
||||||
lx := 0
|
lx := 0
|
||||||
|
a := pair.Attr()
|
||||||
|
|
||||||
var style tcell.Style
|
var style tcell.Style
|
||||||
if w.color {
|
if w.color {
|
||||||
@ -558,12 +559,17 @@ func (w *TcellWindow) fillString(text string, pair ColorPair, a Attr) FillReturn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.lastX += lx
|
w.lastX += lx
|
||||||
|
if w.lastX == w.width {
|
||||||
|
w.lastY++
|
||||||
|
w.lastX = 0
|
||||||
|
return FillNextLine
|
||||||
|
}
|
||||||
|
|
||||||
return FillContinue
|
return FillContinue
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *TcellWindow) Fill(str string) FillReturn {
|
func (w *TcellWindow) Fill(str string) FillReturn {
|
||||||
return w.fillString(str, w.normal, 0)
|
return w.fillString(str, w.normal)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *TcellWindow) CFill(fg Color, bg Color, a Attr, str string) FillReturn {
|
func (w *TcellWindow) CFill(fg Color, bg Color, a Attr, str string) FillReturn {
|
||||||
@ -573,7 +579,7 @@ func (w *TcellWindow) CFill(fg Color, bg Color, a Attr, str string) FillReturn {
|
|||||||
if bg == colDefault {
|
if bg == colDefault {
|
||||||
bg = w.normal.Bg()
|
bg = w.normal.Bg()
|
||||||
}
|
}
|
||||||
return w.fillString(str, NewColorPair(fg, bg, a), a)
|
return w.fillString(str, NewColorPair(fg, bg, a))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *TcellWindow) drawBorder() {
|
func (w *TcellWindow) drawBorder() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user