mirror of https://github.com/Llewellynvdm/fzf.git
Fix rendering of preview window border of tcell renderer
(sleep 1; find .) | go run -tags tcell main.go --bind 'space:change-preview-window(60%|70%|80%|90%|border-left|border-right|border-vertical|border-top|border-horizontal|border-bottom|border-sharp|border-double|border-block|hidden|left|up|down|right|up|down|)' \ --preview 'cat {}' --color bg:red,preview-bg:blue \ --border --margin 3
This commit is contained in:
parent
2bd41f1330
commit
b6add2a257
|
@ -561,7 +561,11 @@ func fill(x, y, w, h int, n ColorPair, r rune) {
|
|||
}
|
||||
|
||||
func (w *TcellWindow) Erase() {
|
||||
fill(w.left-1, w.top, w.width+1, w.height-1, w.normal, ' ')
|
||||
if w.borderStyle.shape.HasLeft() {
|
||||
fill(w.left-1, w.top, w.width, w.height-1, w.normal, ' ')
|
||||
} else {
|
||||
fill(w.left, w.top, w.width-1, w.height-1, w.normal, ' ')
|
||||
}
|
||||
w.drawBorder(false)
|
||||
}
|
||||
|
||||
|
|
|
@ -368,6 +368,14 @@ const (
|
|||
BorderRight
|
||||
)
|
||||
|
||||
func (s BorderShape) HasLeft() bool {
|
||||
switch s {
|
||||
case BorderNone, BorderRight, BorderTop, BorderBottom, BorderHorizontal: // No Left
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (s BorderShape) HasRight() bool {
|
||||
switch s {
|
||||
case BorderNone, BorderLeft, BorderTop, BorderBottom, BorderHorizontal: // No right
|
||||
|
|
Loading…
Reference in New Issue