diff --git a/src/tui/tcell.go b/src/tui/tcell.go index af0902cb..9b8f8620 100644 --- a/src/tui/tcell.go +++ b/src/tui/tcell.go @@ -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) } diff --git a/src/tui/tui.go b/src/tui/tui.go index aec80fcd..7fad8f48 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -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