Add inline header/header-lines/footer borders inside the list frame

Adds a new BorderShape, BorderInline, accepted as a value for
--header-border, --header-lines-border, and --footer-border. When the
surrounding --list-border has both top and bottom horizontals (rounded,
sharp, bold, double, horizontal), the corresponding section is rendered
inside the list frame separated from the list content by a horizontal
line whose endpoints join the list border as T-junctions. Without a
compatible list border, the shape falls back to BorderLine.

Supports:
  - All three layouts (default, reverse, reverse-list).
  - Any combination of the three inline sections, producing stacked
    separators.
  - --header-label and --footer-label rendered on their separator row
    (and redrawn on reqRedrawHeaderLabel / reqRedrawFooterLabel).
  - Section-specific border colors on the separator line, with the
    T-junction characters painted in the list-border color so the outer
    frame stays visually continuous.

Rejects the combinations that do not make sense:
  - --input-border=inline / --list-border=inline / --preview-border=inline
  - --header-first + (--header-border=inline | --header-lines-border=inline)
  - --header-border=inline with a non-inline --header-lines-border
    (inline has to propagate inward toward the list content).
This commit is contained in:
Junegunn Choi
2026-04-18 13:11:48 +09:00
parent f56bdd2ca9
commit e873128d93
8 changed files with 409 additions and 36 deletions
+14 -2
View File
@@ -1100,7 +1100,13 @@ Print header before the prompt line. When both normal header and header lines
.TP
.BI "\-\-header\-border" [=STYLE]
Draw border around the header section. \fBline\fR style draws a single
separator line between the header window and the list section.
separator line between the header window and the list section. \fBinline\fR
style embeds the header inside the list border frame, joined to the list
section by a horizontal separator with T-junctions; it requires a
line-drawing \fB\-\-list\-border\fR (rounded / sharp / bold / double /
horizontal) and falls back to \fBline\fR otherwise. Not compatible with
\fB\-\-header\-first\fR, and when \fB\-\-header\-lines\fR is also set
\fB\-\-header\-lines\-border\fR must also be \fBinline\fR.
.TP
.BI "\-\-header\-label" [=LABEL]
@@ -1116,6 +1122,9 @@ Display header from \fB--header\-lines\fR with a separate border. Pass
\fBnone\fR to still separate the header lines but without a border. To combine
two headers, use \fB\-\-no\-header\-lines\-border\fR. \fBline\fR style draws
a single separator line between the header lines and the list section.
\fBinline\fR style embeds the header lines inside the list border frame
with a T-junction separator; it requires a line-drawing
\fB\-\-list\-border\fR and is not compatible with \fB\-\-header\-first\fR.
.SS FOOTER
@@ -1129,7 +1138,10 @@ are not affected by \fB\-\-with\-nth\fR. ANSI color codes are processed even whe
.TP
.BI "\-\-footer\-border" [=STYLE]
Draw border around the footer section. \fBline\fR style draws a single
separator line between the footer and the list section.
separator line between the footer and the list section. \fBinline\fR style
embeds the footer inside the list border frame with a T-junction separator;
it requires a line-drawing \fB\-\-list\-border\fR and falls back to
\fBline\fR otherwise.
.TP
.BI "\-\-footer\-label" [=LABEL]