From 0e0b86834294e1befb9e1ce16239230aa40d1add Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 6 Jan 2025 00:44:59 +0900 Subject: Add preview border style 'line' It draws a single line between the preview window and the rest of the interface. i.e. automatically choose between 'left', 'right', 'top', and 'bottom' depending on the position of the preview window. --- src/tui/tui.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/tui') diff --git a/src/tui/tui.go b/src/tui/tui.go index db846f75..2bd9caf9 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -358,6 +358,7 @@ type BorderShape int const ( BorderUndefined BorderShape = iota + BorderLine BorderNone BorderRounded BorderSharp @@ -375,7 +376,7 @@ const ( func (s BorderShape) HasLeft() bool { switch s { - case BorderNone, BorderRight, BorderTop, BorderBottom, BorderHorizontal: // No Left + case BorderNone, BorderLine, BorderRight, BorderTop, BorderBottom, BorderHorizontal: // No Left return false } return true @@ -383,7 +384,7 @@ func (s BorderShape) HasLeft() bool { func (s BorderShape) HasRight() bool { switch s { - case BorderNone, BorderLeft, BorderTop, BorderBottom, BorderHorizontal: // No right + case BorderNone, BorderLine, BorderLeft, BorderTop, BorderBottom, BorderHorizontal: // No right return false } return true @@ -391,7 +392,7 @@ func (s BorderShape) HasRight() bool { func (s BorderShape) HasTop() bool { switch s { - case BorderNone, BorderLeft, BorderRight, BorderBottom, BorderVertical: // No top + case BorderNone, BorderLine, BorderLeft, BorderRight, BorderBottom, BorderVertical: // No top return false } return true @@ -399,7 +400,7 @@ func (s BorderShape) HasTop() bool { func (s BorderShape) HasBottom() bool { switch s { - case BorderNone, BorderLeft, BorderRight, BorderTop, BorderVertical: // No bottom + case BorderNone, BorderLine, BorderLeft, BorderRight, BorderTop, BorderVertical: // No bottom return false } return true -- cgit v1.2.3