m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-14 06:13:47 -05:00

Set the default value of --min-height depending on other options

This commit is contained in:
Junegunn Choi
2025-01-27 20:33:47 +09:00
parent a6a558da30
commit 51c207448d
3 changed files with 50 additions and 14 deletions

View File

@@ -799,7 +799,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
if previewBox != nil && opts.Preview.aboveOrBelow() {
effectiveMinHeight += 1 + borderLines(opts.Preview.Border())
}
if noSeparatorLine(opts.InfoStyle, opts.Separator == nil || uniseg.StringWidth(*opts.Separator) > 0) {
if opts.noSeparatorLine() {
effectiveMinHeight--
}
effectiveMinHeight += borderLines(opts.BorderShape)
@@ -1264,16 +1264,6 @@ func (t *Terminal) parsePrompt(prompt string) (func(), int) {
return output, promptLen
}
func noSeparatorLine(style infoStyle, separator bool) bool {
switch style {
case infoInline:
return true
case infoHidden, infoInlineRight:
return !separator
}
return false
}
func (t *Terminal) noSeparatorLine() bool {
return noSeparatorLine(t.infoStyle, t.separatorLen > 0)
}