diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2025-01-23 01:39:57 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2025-01-23 01:39:57 +0900 |
| commit | 06547d0cbe82f516904a54579a73fa01b1bb64bf (patch) | |
| tree | ee995c72623f8bf51031811029885e30f5d66bdd /src/tui/tui.go | |
| parent | 578108280e081c9996eb7df578aac4e1dd1a6f94 (diff) | |
| download | fzf-06547d0cbe82f516904a54579a73fa01b1bb64bf.tar.gz | |
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
Diffstat (limited to 'src/tui/tui.go')
| -rw-r--r-- | src/tui/tui.go | 11 |
1 files changed, 6 insertions, 5 deletions
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: ' ', |
