diff options
Diffstat (limited to 'src/options.go')
| -rw-r--r-- | src/options.go | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/options.go b/src/options.go index cc627ee1..fec9596c 100644 --- a/src/options.go +++ b/src/options.go @@ -127,6 +127,7 @@ Usage: fzf [options] (default: 0 or center) INPUT SECTION + --no-input Disable and hide the input section --prompt=STR Input prompt (default: '> ') --info=STYLE Finder info style [default|right|hidden|inline[-right][:PREFIX]] @@ -538,6 +539,7 @@ type Options struct { Scheme string Extended bool Phony bool + Inputless bool Case Case Normalize bool Nth []Range @@ -659,6 +661,7 @@ func defaultOptions() *Options { Scheme: "", // Unknown Extended: true, Phony: false, + Inputless: false, Case: CaseSmart, Normalize: true, Nth: make([]Range, 0), @@ -2315,6 +2318,8 @@ func parseOptions(index *int, opts *Options, allArgs []string) error { opts.Phony = false case "--disabled", "--phony": opts.Phony = true + case "--no-input": + opts.Inputless = true case "--tiebreak": str, err := nextString("sort criterion required") if err != nil { @@ -3064,6 +3069,9 @@ func noSeparatorLine(style infoStyle, separator bool) bool { } func (opts *Options) noSeparatorLine() bool { + if opts.Inputless { + return true + } sep := opts.Separator == nil && !opts.InputBorderShape.Visible() || opts.Separator != nil && len(*opts.Separator) > 0 return noSeparatorLine(opts.InfoStyle, sep) } @@ -3235,7 +3243,13 @@ func postProcessOptions(opts *Options) error { // Sets --min-height automatically if opts.Height.size > 0 && opts.Height.percent && opts.MinHeight < 0 { - opts.MinHeight = -opts.MinHeight + 1 + borderLines(opts.BorderShape) + borderLines(opts.ListBorderShape) + borderLines(opts.InputBorderShape) + opts.MinHeight = -opts.MinHeight + borderLines(opts.BorderShape) + borderLines(opts.ListBorderShape) + if !opts.Inputless { + opts.MinHeight += 1 + borderLines(opts.InputBorderShape) + if !opts.noSeparatorLine() { + opts.MinHeight++ + } + } if len(opts.Header) > 0 { opts.MinHeight += borderLines(opts.HeaderBorderShape) + len(opts.Header) } @@ -3246,9 +3260,6 @@ func postProcessOptions(opts *Options) error { } opts.MinHeight += borderLines(borderShape) + opts.HeaderLines } - if !opts.noSeparatorLine() { - opts.MinHeight++ - } if len(opts.Preview.command) > 0 && (opts.Preview.position == posUp || opts.Preview.position == posDown) && opts.Preview.Visible() && opts.Preview.position == posUp { borderShape := opts.Preview.border if opts.Preview.border == tui.BorderLine { |
