From 06547d0cbe82f516904a54579a73fa01b1bb64bf Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 23 Jan 2025 01:39:57 +0900 Subject: Add --header-lines-border to separate two headers Examples: # Border only around the header from --header-lines seq 10 | fzf --header 'hello' --header-lines 2 --header-lines-border # Both headers with borders seq 10 | fzf --header 'hello' --header-lines 2 --header-border --header-lines-border # Use 'none' to still separate two headers but without a border seq 10 | fzf --header 'hello' --header-lines 2 --header-border --header-lines-border none --list-border --- src/tui/tui.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/tui') diff --git a/src/tui/tui.go b/src/tui/tui.go index 58c1bec5..32aefc79 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -376,6 +376,7 @@ const ( BorderUndefined BorderShape = iota BorderLine BorderNone + BorderPhantom BorderRounded BorderSharp BorderBold @@ -392,7 +393,7 @@ const ( func (s BorderShape) HasLeft() bool { switch s { - case BorderNone, BorderLine, BorderRight, BorderTop, BorderBottom, BorderHorizontal: // No Left + case BorderNone, BorderPhantom, BorderLine, BorderRight, BorderTop, BorderBottom, BorderHorizontal: // No Left return false } return true @@ -400,7 +401,7 @@ func (s BorderShape) HasLeft() bool { func (s BorderShape) HasRight() bool { switch s { - case BorderNone, BorderLine, BorderLeft, BorderTop, BorderBottom, BorderHorizontal: // No right + case BorderNone, BorderPhantom, BorderLine, BorderLeft, BorderTop, BorderBottom, BorderHorizontal: // No right return false } return true @@ -408,7 +409,7 @@ func (s BorderShape) HasRight() bool { func (s BorderShape) HasTop() bool { switch s { - case BorderNone, BorderLine, BorderLeft, BorderRight, BorderBottom, BorderVertical: // No top + case BorderNone, BorderPhantom, BorderLine, BorderLeft, BorderRight, BorderBottom, BorderVertical: // No top return false } return true @@ -416,7 +417,7 @@ func (s BorderShape) HasTop() bool { func (s BorderShape) HasBottom() bool { switch s { - case BorderNone, BorderLine, BorderLeft, BorderRight, BorderTop, BorderVertical: // No bottom + case BorderNone, BorderPhantom, BorderLine, BorderLeft, BorderRight, BorderTop, BorderVertical: // No bottom return false } return true @@ -441,7 +442,7 @@ type BorderStyle struct { type BorderCharacter int func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle { - if shape == BorderNone { + if shape == BorderNone || shape == BorderPhantom { return BorderStyle{ shape: shape, top: ' ', -- cgit v1.2.3