Skip to content
Snippets Groups Projects
Unverified Commit 2886f069 authored by Junegunn Choi's avatar Junegunn Choi
Browse files

Fix --preview-window noborder with non-default background color

parent d630484e
No related branches found
No related tags found
No related merge requests found
......@@ -624,9 +624,9 @@ func (t *Terminal) resizeWindows() {
noBorder := tui.MakeBorderStyle(tui.BorderNone, t.unicode)
if previewVisible {
createPreviewWindow := func(y int, x int, w int, h int) {
previewBorder := noBorder
if t.preview.border {
previewBorder = tui.MakeBorderStyle(tui.BorderAround, t.unicode)
previewBorder := tui.MakeBorderStyle(tui.BorderAround, t.unicode)
if !t.preview.border {
previewBorder = tui.MakeTransparentBorder()
}
t.pborder = t.tui.NewWindow(y, x, w, h, previewBorder)
pwidth := w - 4
......
......@@ -221,6 +221,8 @@ type BorderStyle struct {
bottomRight rune
}
type BorderCharacter int
func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {
if unicode {
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 {
Init()
Pause(clear bool)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment