diff --git a/src/terminal.go b/src/terminal.go index 1b3efde..7ea6174 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -1531,15 +1531,16 @@ func (t *Terminal) adjustMarginAndPadding() (int, int, [4]int, [4]int) { return screenWidth, screenHeight, marginInt, paddingInt } -func (t *Terminal) resizeWindows(forcePreview bool) { +func (t *Terminal) resizeWindows(forcePreview bool, redrawBorder bool) { t.forcePreview = forcePreview screenWidth, screenHeight, marginInt, paddingInt := t.adjustMarginAndPadding() width := screenWidth - marginInt[1] - marginInt[3] height := screenHeight - marginInt[0] - marginInt[2] t.prevLines = make([]itemLine, screenHeight) - if t.border != nil { + if t.border != nil && redrawBorder { t.border.Close() + t.border = nil } if t.window != nil { t.window.Close() @@ -1573,7 +1574,7 @@ func (t *Terminal) resizeWindows(forcePreview bool) { offsets[1] -= 1 + bw offsets[2] += 1 + bw } - if t.borderShape != tui.BorderNone { + if t.border == nil && t.borderShape != tui.BorderNone { t.border = t.tui.NewWindow( marginInt[0]+offsets[0], marginInt[3]+offsets[1], width+offsets[2], height+offsets[3], false, tui.MakeBorderStyle(t.borderShape, t.unicode)) @@ -2935,7 +2936,7 @@ func (t *Terminal) processTabs(runes []rune, prefixWidth int) (string, int) { } func (t *Terminal) printAll() { - t.resizeWindows(t.forcePreview) + t.resizeWindows(t.forcePreview, true) t.printList() t.printPrompt() t.printInfo() @@ -3561,7 +3562,7 @@ func (t *Terminal) Loop() error { return err } t.termSize = t.tui.Size() - t.resizeWindows(false) + t.resizeWindows(false, false) t.window.Erase() t.mutex.Unlock() @@ -4037,7 +4038,7 @@ func (t *Terminal) Loop() error { } } updatePreviewWindow := func(forcePreview bool) { - t.resizeWindows(forcePreview) + t.resizeWindows(forcePreview, false) req(reqPrompt, reqList, reqInfo, reqHeader) } toggle := func() bool { diff --git a/src/tui/tui.go b/src/tui/tui.go index 04d548f..c533084 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -412,7 +412,7 @@ type BorderCharacter int func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle { if shape == BorderNone { return BorderStyle{ - shape: BorderRounded, + shape: shape, top: ' ', bottom: ' ', left: ' ',