mirror of
https://github.com/junegunn/fzf.git
synced 2026-04-27 01:40:34 +08:00
Let inline sections take precedence over --header-first
--header-first previously was rejected with --header-border=inline or --header-lines-border=inline. Now, inline placement wins: an inline section stays inside the list frame, and --header-first only affects non-inline sections (mainly the main --header).
This commit is contained in:
@@ -3619,9 +3619,6 @@ func validateOptions(opts *Options) error {
|
||||
opts.Preview.border == tui.BorderInline {
|
||||
return errors.New("inline border is only supported for --header-border, --header-lines-border, and --footer-border")
|
||||
}
|
||||
if opts.HeaderFirst && (opts.HeaderBorderShape == tui.BorderInline || opts.HeaderLinesShape == tui.BorderInline) {
|
||||
return errors.New("--header-first is not compatible with --header-border=inline or --header-lines-border=inline")
|
||||
}
|
||||
if opts.HeaderBorderShape == tui.BorderInline &&
|
||||
opts.HeaderLinesShape != tui.BorderInline &&
|
||||
opts.HeaderLinesShape != tui.BorderUndefined &&
|
||||
|
||||
+5
-1
@@ -2844,7 +2844,11 @@ func (t *Terminal) resizeWindows(forcePreview bool, redrawBorder bool) {
|
||||
|
||||
if hasInputWindow {
|
||||
var btop int
|
||||
if (hasHeaderWindow || hasHeaderLinesWindow) && t.headerFirst {
|
||||
// Inline sections live inside the list frame, so they don't participate
|
||||
// in --header-first repositioning; only non-inline sections do.
|
||||
hasNonInlineHeader := hasHeaderWindow && t.headerBorderShape != tui.BorderInline
|
||||
hasNonInlineHeaderLines := hasHeaderLinesWindow && headerLinesShape != tui.BorderInline
|
||||
if (hasNonInlineHeader || hasNonInlineHeaderLines) && t.headerFirst {
|
||||
switch t.layout {
|
||||
case layoutDefault:
|
||||
btop = w.Top() + w.Height()
|
||||
|
||||
Reference in New Issue
Block a user