mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-23 23:28:31 +00:00
Fix --preview-window noborder with non-default background color
This commit is contained in:
parent
d630484eeb
commit
2886f06977
@ -624,9 +624,9 @@ func (t *Terminal) resizeWindows() {
|
|||||||
noBorder := tui.MakeBorderStyle(tui.BorderNone, t.unicode)
|
noBorder := tui.MakeBorderStyle(tui.BorderNone, t.unicode)
|
||||||
if previewVisible {
|
if previewVisible {
|
||||||
createPreviewWindow := func(y int, x int, w int, h int) {
|
createPreviewWindow := func(y int, x int, w int, h int) {
|
||||||
previewBorder := noBorder
|
previewBorder := tui.MakeBorderStyle(tui.BorderAround, t.unicode)
|
||||||
if t.preview.border {
|
if !t.preview.border {
|
||||||
previewBorder = tui.MakeBorderStyle(tui.BorderAround, t.unicode)
|
previewBorder = tui.MakeTransparentBorder()
|
||||||
}
|
}
|
||||||
t.pborder = t.tui.NewWindow(y, x, w, h, previewBorder)
|
t.pborder = t.tui.NewWindow(y, x, w, h, previewBorder)
|
||||||
pwidth := w - 4
|
pwidth := w - 4
|
||||||
|
@ -221,6 +221,8 @@ type BorderStyle struct {
|
|||||||
bottomRight rune
|
bottomRight rune
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type BorderCharacter int
|
||||||
|
|
||||||
func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {
|
func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {
|
||||||
if unicode {
|
if unicode {
|
||||||
return BorderStyle{
|
return BorderStyle{
|
||||||
@ -244,6 +246,17 @@ func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func MakeTransparentBorder() BorderStyle {
|
||||||
|
return BorderStyle{
|
||||||
|
shape: BorderAround,
|
||||||
|
horizontal: ' ',
|
||||||
|
vertical: ' ',
|
||||||
|
topLeft: ' ',
|
||||||
|
topRight: ' ',
|
||||||
|
bottomLeft: ' ',
|
||||||
|
bottomRight: ' '}
|
||||||
|
}
|
||||||
|
|
||||||
type Renderer interface {
|
type Renderer interface {
|
||||||
Init()
|
Init()
|
||||||
Pause(clear bool)
|
Pause(clear bool)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user