mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-06 07:02:09 -07:00
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
This commit is contained in:
@@ -164,6 +164,9 @@ Usage: fzf [options]
|
||||
--header-border[=STYLE] Draw border around the header section
|
||||
[rounded|sharp|bold|block|thinblock|double|horizontal|vertical|
|
||||
top|bottom|left|right|none] (default: rounded)
|
||||
--header-lines-border[=STYLE]
|
||||
Display header from --header-lines with a separate border.
|
||||
Pass 'none' to still separate it but without a border.
|
||||
--header-label=LABEL Label to print on the header border
|
||||
--header-label-pos=COL Position of the header label
|
||||
[POSITIVE_INTEGER: columns from left|
|
||||
@@ -597,6 +600,7 @@ type Options struct {
|
||||
ListBorderShape tui.BorderShape
|
||||
InputBorderShape tui.BorderShape
|
||||
HeaderBorderShape tui.BorderShape
|
||||
HeaderLinesShape tui.BorderShape
|
||||
InputLabel labelOpts
|
||||
HeaderLabel labelOpts
|
||||
BorderLabel labelOpts
|
||||
@@ -2669,6 +2673,13 @@ func parseOptions(index *int, opts *Options, allArgs []string) error {
|
||||
if opts.HeaderBorderShape, err = parseBorder(arg, !hasArg, false); err != nil {
|
||||
return err
|
||||
}
|
||||
case "--no-header-lines-border":
|
||||
opts.HeaderLinesShape = tui.BorderNone
|
||||
case "--header-lines-border":
|
||||
hasArg, arg := optionalNextString()
|
||||
if opts.HeaderLinesShape, err = parseBorder(arg, !hasArg, false); err != nil {
|
||||
return err
|
||||
}
|
||||
case "--no-header-label":
|
||||
opts.HeaderLabel.label = ""
|
||||
case "--header-label":
|
||||
@@ -3016,6 +3027,12 @@ func postProcessOptions(opts *Options) error {
|
||||
opts.HeaderBorderShape = tui.BorderNone
|
||||
}
|
||||
|
||||
if opts.HeaderLinesShape == tui.BorderNone {
|
||||
opts.HeaderLinesShape = tui.BorderPhantom
|
||||
} else if opts.HeaderLinesShape == tui.BorderUndefined {
|
||||
opts.HeaderLinesShape = tui.BorderNone
|
||||
}
|
||||
|
||||
if opts.Pointer == nil {
|
||||
defaultPointer := "▌"
|
||||
if !opts.Unicode {
|
||||
|
Reference in New Issue
Block a user