Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent d630484 · Browse files · 2 files+16 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−3 removed

  • other:+16 added−3 removed

2 files+16 added−3 removed

modified:src/tui/tui.go+13 added
219 unmodified lines
220 bottomLeft rune221 bottomRight rune222}223224type BorderCharacter int225226func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {227 if unicode {228 return BorderStyle{229 shape: shape,
15 unmodified lines
245 bottomRight: '+',246 }247}248249func MakeTransparentBorder() BorderStyle {250 return BorderStyle{251 shape: BorderAround,252 horizontal: ' ',253 vertical: ' ',254 topLeft: ' ',255 topRight: ' ',256 bottomLeft: ' ',257 bottomRight: ' '}258}259260type Renderer interface {261 Init()262 Pause(clear bool)263 Resume(clear bool)
228 unmodified lines
modified:src/terminal.go+3 added-3 removed
622 unmodified lines
623 }624 noBorder := tui.MakeBorderStyle(tui.BorderNone, t.unicode)625 if previewVisible {626 createPreviewWindow := func(y int, x int, w int, h int) {627 previewBorder := noBorder628 if t.preview.border {629 previewBorder = tui.MakeBorderStyle(tui.BorderAround, t.unicode)627 previewBorder := tui.MakeBorderStyle(tui.BorderAround, t.unicode)628 if !t.preview.border {629 previewBorder = tui.MakeTransparentBorder()630 }631 t.pborder = t.tui.NewWindow(y, x, w, h, previewBorder)632 pwidth := w - 4633 // ncurses auto-wraps the line when the cursor reaches the right-end of
1533 unmodified lines