Add --header-lines-border to separate two headers
Before adoption: this commit came in with the history the project adopted, so no landing records it.
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
authored by Junegunn Choi · committed by Junegunn Choi · parent 5781082 · Browse files · 5 files·+386 added−51 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+386 added−51 removed
- tests:+186 added−12 removed
- other:+200 added−39 removed
Provenance
- Commit
06547d0- Tree
ee995c7- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
5781082
5 files changed+386 added−51 removed
modified:man/man1/fzf.1+6 added
927 unmodified lines928 .TP929 .BI "\-\-header\-label\-pos" [=N[:top|bottom]]930 Position of the header label931 932+.TP933+.BI "\-\-header\-lines\-border" [=STYLE]934+Display header from \fB--header-lines\fR with a separate border. Pass935+\fBnone\fR to still separate the header lines but without a border. To combine936+two headers, use \fB\-\-no\-header\-lines\-border\fR.937+938 .SS SCRIPTING939 .TP940 .BI "\-q, \-\-query=" "STR"941 Start the finder with the given query868 unmodified linesmodified:src/tui/tui.go+6 added-5 removed
374 unmodified lines375 const (376 BorderUndefined BorderShape = iota377 BorderLine378 BorderNone379+ BorderPhantom380 BorderRounded381 BorderSharp382 BorderBold383 BorderBlock8 unmodified lines392 )393 394 func (s BorderShape) HasLeft() bool {395 switch s {395- case BorderNone, BorderLine, BorderRight, BorderTop, BorderBottom, BorderHorizontal: // No Left396+ case BorderNone, BorderPhantom, BorderLine, BorderRight, BorderTop, BorderBottom, BorderHorizontal: // No Left397 return false398 }399 return true400 }401 402 func (s BorderShape) HasRight() bool {403 switch s {403- case BorderNone, BorderLine, BorderLeft, BorderTop, BorderBottom, BorderHorizontal: // No right404+ case BorderNone, BorderPhantom, BorderLine, BorderLeft, BorderTop, BorderBottom, BorderHorizontal: // No right405 return false406 }407 return true408 }409 410 func (s BorderShape) HasTop() bool {411 switch s {411- case BorderNone, BorderLine, BorderLeft, BorderRight, BorderBottom, BorderVertical: // No top412+ case BorderNone, BorderPhantom, BorderLine, BorderLeft, BorderRight, BorderBottom, BorderVertical: // No top413 return false414 }415 return true416 }417 418 func (s BorderShape) HasBottom() bool {419 switch s {419- case BorderNone, BorderLine, BorderLeft, BorderRight, BorderTop, BorderVertical: // No bottom420+ case BorderNone, BorderPhantom, BorderLine, BorderLeft, BorderRight, BorderTop, BorderVertical: // No bottom421 return false422 }423 return true424 }16 unmodified lines441 442 type BorderCharacter int443 444 func MakeBorderStyle(shape BorderShape, unicode bool) BorderStyle {444- if shape == BorderNone {445+ if shape == BorderNone || shape == BorderPhantom {446 return BorderStyle{447 shape: shape,448 top: ' ',449 bottom: ' ',586 unmodified linesmodified:src/options.go+17 added
162 unmodified lines163 --header-first Print header before the prompt line164 --header-border[=STYLE] Draw border around the header section165 [rounded|sharp|bold|block|thinblock|double|horizontal|vertical|166 top|bottom|left|right|none] (default: rounded)167+ --header-lines-border[=STYLE]168+ Display header from --header-lines with a separate border.169+ Pass 'none' to still separate it but without a border.170 --header-label=LABEL Label to print on the header border171 --header-label-pos=COL Position of the header label172 [POSITIVE_INTEGER: columns from left|173 NEGATIVE_INTEGER: columns from right][:bottom]425 unmodified lines599 BorderShape tui.BorderShape600 ListBorderShape tui.BorderShape601 InputBorderShape tui.BorderShape602 HeaderBorderShape tui.BorderShape603+ HeaderLinesShape tui.BorderShape604 InputLabel labelOpts605 HeaderLabel labelOpts606 BorderLabel labelOpts607 ListLabel labelOpts2064 unmodified lines2672 hasArg, arg := optionalNextString()2673 if opts.HeaderBorderShape, err = parseBorder(arg, !hasArg, false); err != nil {2674 return err2675 }2676+ case "--no-header-lines-border":2677+ opts.HeaderLinesShape = tui.BorderNone2678+ case "--header-lines-border":2679+ hasArg, arg := optionalNextString()2680+ if opts.HeaderLinesShape, err = parseBorder(arg, !hasArg, false); err != nil {2681+ return err2682+ }2683 case "--no-header-label":2684 opts.HeaderLabel.label = ""2685 case "--header-label":2686 if opts.HeaderLabel.label, err = nextString("header label required"); err != nil {339 unmodified lines3026 if opts.HeaderBorderShape == tui.BorderUndefined {3027 opts.HeaderBorderShape = tui.BorderNone3028 }3029 3030+ if opts.HeaderLinesShape == tui.BorderNone {3031+ opts.HeaderLinesShape = tui.BorderPhantom3032+ } else if opts.HeaderLinesShape == tui.BorderUndefined {3033+ opts.HeaderLinesShape = tui.BorderNone3034+ }3035+3036 if opts.Pointer == nil {3037 defaultPointer := "▌"3038 if !opts.Unicode {3039 defaultPointer = ">"209 unmodified linesmodified:src/terminal.go+171 added-34 removed
314 unmodified lines315 borderShape tui.BorderShape316 listBorderShape tui.BorderShape317 inputBorderShape tui.BorderShape318 headerBorderShape tui.BorderShape319+ headerLinesShape tui.BorderShape320 listLabel labelPrinter321 listLabelLen int322 listLabelOpts labelOpts323 cleanExit bool4 unmodified lines328 inputWindow tui.Window329 inputBorder tui.Window330 headerWindow tui.Window331 headerBorder tui.Window332+ headerLinesWindow tui.Window333+ headerLinesBorder tui.Window334 wborder tui.Window335 pborder tui.Window336 pwindow tui.Window337 borderWidth int528 unmodified lines866 borderShape: opts.BorderShape,867 listBorderShape: opts.ListBorderShape,868 inputBorderShape: opts.InputBorderShape,869 headerBorderShape: opts.HeaderBorderShape,870+ headerLinesShape: opts.HeaderLinesShape,871 borderWidth: 1,872 listLabel: nil,873 listLabelOpts: opts.ListLabel,874 borderLabel: nil,234 unmodified lines1109 return len(t.header0) + t.headerLines1110 }1111 1112 func (t *Terminal) visibleHeaderLinesInList() int {1109- if t.headerWindow != nil {1113+ if t.headerWindow != nil || t.headerLinesWindow != nil {1114 return 01115 }1116 return t.visibleHeaderLines()1117 }1118 1119 // Extra number of lines needed to display fzf1120 func (t *Terminal) extraLines() int {1117- extra := t.visibleHeaderLines() + 11121+ extra := 11122 if t.inputBorderShape.Visible() {1123 extra += borderLines(t.inputBorderShape)1124 }1125 if t.listBorderShape.Visible() {1126 extra += borderLines(t.listBorderShape)1127 }1124- if t.headerBorderShape.Visible() {1125- extra += borderLines(t.headerBorderShape)1128+ if t.headerVisible {1129+ if t.hasHeaderWindow() {1130+ extra += borderLines(t.headerBorderShape)1131+ }1132+ extra += len(t.header0)1133+ if t.hasHeaderLinesWindow() {1134+ extra += borderLines(t.headerLinesShape)1135+ }1136+ extra += t.headerLines1137 }1138 if !t.noSeparatorLine() {1139 extra++1140 }513 unmodified lines1654 func (t *Terminal) forceRerenderList() {1655 t.prevLines = make([]itemLine, len(t.prevLines))1656 }1657 1658+func (t *Terminal) hasHeaderWindow() bool {1659+ if !t.headerVisible {1660+ return false1661+ }1662+ if t.hasHeaderLinesWindow() {1663+ return len(t.header0) > 01664+ }1665+ if t.headerBorderShape.Visible() {1666+ return len(t.header0)+t.headerLines > 01667+ }1668+ return t.inputBorderShape.Visible()1669+}1670+1671+func (t *Terminal) hasHeaderLinesWindow() bool {1672+ return t.headerVisible && t.headerLines > 0 && t.headerLinesShape.Visible()1673+}1674+1675 func (t *Terminal) resizeWindows(forcePreview bool, redrawBorder bool) {1676 t.forcePreview = forcePreview1677 screenWidth, screenHeight, marginInt, paddingInt := t.adjustMarginAndPadding()1678 width := screenWidth - marginInt[1] - marginInt[3]14 unmodified lines1693 }1694 if t.headerBorder != nil {1695 t.headerBorder = nil1696 }1697+ if t.headerLinesWindow != nil {1698+ t.headerLinesWindow = nil1699+ }1700+ if t.headerLinesBorder != nil {1701+ t.headerLinesBorder = nil1702+ }1703 if t.inputWindow != nil {1704 t.inputWindow = nil1705 }1706 if t.inputBorder != nil {42 unmodified lines1749 inputBorderHeight := 01750 availableLines := height1751 shift := 01752 shrink := 01719- hasInputWindow := t.inputBorderShape.Visible() || t.headerBorderShape.Visible()1753+ hasHeaderWindow := t.hasHeaderWindow()1754+ hasHeaderLinesWindow := t.hasHeaderLinesWindow()1755+ hasInputWindow := t.inputBorderShape.Visible() || hasHeaderWindow || hasHeaderLinesWindow1756 if hasInputWindow {1757 inputWindowHeight := 21758 if t.noSeparatorLine() {1759 inputWindowHeight--8 unmodified lines1768 availableLines -= inputBorderHeight1769 }1770 1771 // Adjust position and size of the list window if header border is set1736- hasHeaderWindow := t.visibleHeaderLines() > 0 && (t.headerBorderShape.Visible() || t.inputBorderShape.Visible())1772 headerBorderHeight := 01773 if hasHeaderWindow {1774 headerWindowHeight := t.visibleHeaderLines()1775+ if hasHeaderLinesWindow {1776+ headerWindowHeight -= t.headerLines1777+ }1778 headerBorderHeight = util.Min(availableLines, borderLines(t.headerBorderShape)+headerWindowHeight)1779 if t.layout == layoutReverse {1780 shift += headerBorderHeight1781 shrink += headerBorderHeight2 unmodified lines1784 }1785 availableLines -= headerBorderHeight1786 }1787 1788+ headerLinesHeight := 01789+ if hasHeaderLinesWindow {1790+ headerLinesHeight = util.Min(availableLines, borderLines(t.headerLinesShape)+t.headerLines)1791+ if t.layout == layoutReverse {1792+ shift += headerLinesHeight1793+ shrink += headerLinesHeight1794+ } else {1795+ shrink += headerLinesHeight1796+ }1797+ availableLines -= headerLinesHeight1798+ }1799+1800 // Set up list border1801 hasListBorder := t.listBorderShape.Visible()1802 innerWidth := width1803 innerHeight := height240 unmodified lines2044 if hasInputWindow {2045 var btop int2046 if hasHeaderWindow && t.headerFirst {2047 if t.layout == layoutReverse {1998- btop = w.Top() - inputBorderHeight2048+ btop = w.Top() - inputBorderHeight - headerLinesHeight2049 } else {2000- btop = w.Top() + w.Height()2050+ btop = w.Top() + w.Height() + headerLinesHeight2051 }2052 } else {2053 if t.layout == layoutReverse {2054 btop = w.Top() - shrink2055 } else {2006- btop = w.Top() + w.Height() + headerBorderHeight2056+ btop = w.Top() + w.Height() + headerBorderHeight + headerLinesHeight2057 }2058 }2059+ left := w.Left()2060+ if !t.inputBorderShape.HasLeft() && t.listBorderShape.HasLeft() {2061+ left += t.borderWidth + 12062+ }2063+ width := w.Width()2064+ if t.listBorderShape.HasRight() && !t.inputBorderShape.HasRight() {2065+ width -= t.borderWidth + 12066+ }2067 t.inputBorder = t.tui.NewWindow(2068 btop,2011- w.Left(),2012- w.Width(),2069+ left,2070+ width,2071 inputBorderHeight, tui.WindowInput, tui.MakeBorderStyle(t.inputBorderShape, t.unicode), true)2072+ if left > w.Left() {2073+ // Small box on the left to erase the residue2074+ // e.g.2075+ // fzf --list-border --header-border --bind 'space:change-header(hello),enter:change-header()'2076+ t.tui.NewWindow(btop, w.Left(), left-w.Left(), inputBorderHeight, tui.WindowInput, noBorder, false).Erase()2077+ }2078 t.inputWindow = createInnerWindow(t.inputBorder, t.inputBorderShape, tui.WindowInput)2079 }2080 2081 // Set up header border2 unmodified lines2084 if hasInputWindow && t.headerFirst {2085 if t.layout == layoutReverse {2086 btop = w.Top() - shrink2087 } else {2024- btop = w.Top() + w.Height() + inputBorderHeight2088+ btop = w.Top() + w.Height() + inputBorderHeight + headerLinesHeight2089 }2090 } else {2091 if t.layout == layoutReverse {2028- btop = w.Top() - headerBorderHeight2092+ btop = w.Top() - headerBorderHeight - headerLinesHeight2093 } else {2030- btop = w.Top() + w.Height()2094+ btop = w.Top() + w.Height() + headerLinesHeight2095 }2096 }2097+ width := w.Width()2098+ if t.listBorderShape.HasRight() && !t.headerBorderShape.HasRight() {2099+ width -= t.borderWidth + 12100+ }2101+2102 t.headerBorder = t.tui.NewWindow(2103 btop,2104 w.Left(),2036- w.Width(),2105+ width,2106 headerBorderHeight, tui.WindowHeader, tui.MakeBorderStyle(t.headerBorderShape, t.unicode), true)2107 t.headerWindow = createInnerWindow(t.headerBorder, t.headerBorderShape, tui.WindowHeader)2108 }2109 2110+ // Set up header lines border2111+ if hasHeaderLinesWindow {2112+ var btop int2113+ if t.layout == layoutReverse {2114+ btop = w.Top() - headerLinesHeight2115+ } else {2116+ btop = w.Top() + w.Height()2117+ }2118+ width := w.Width()2119+ if t.listBorderShape.HasRight() && !t.headerLinesShape.HasRight() {2120+ width -= t.borderWidth + 12121+ }2122+ t.headerLinesBorder = t.tui.NewWindow(2123+ btop,2124+ w.Left(),2125+ width,2126+ headerLinesHeight, tui.WindowHeader, tui.MakeBorderStyle(t.headerLinesShape, t.unicode), true)2127+ t.headerLinesWindow = createInnerWindow(t.headerLinesBorder, t.headerLinesShape, tui.WindowHeader)2128+ }2129+2130 // Print border label2131 t.printLabel(t.wborder, t.listLabel, t.listLabelOpts, t.listLabelLen, t.listBorderShape, false)2132 t.printLabel(t.border, t.borderLabel, t.borderLabelOpts, t.borderLabelLen, t.borderShape, false)2133 t.printLabel(t.pborder, t.previewLabel, t.previewLabelOpts, t.previewLabelLen, t.activePreviewOpts.Border(), false)337 unmodified lines2471 }2472 }2473 2474 func (t *Terminal) printHeader() {2386- headerLines := t.visibleHeaderLines()2387- if t.headerBorderShape.Visible() && (t.headerWindow == nil && headerLines > 0 || t.headerWindow != nil && headerLines != t.headerWindow.Height()) {2475+ allHeaderLines := t.visibleHeaderLines()2476+ primaryHeaderLines := allHeaderLines2477+ if t.headerLinesShape.Visible() {2478+ primaryHeaderLines -= t.headerLines2479+ }2480+ // We may need to resize header windows2481+ if (t.headerBorderShape.Visible() || t.headerLinesShape.Visible()) &&2482+ (t.headerWindow == nil && primaryHeaderLines > 0 || t.headerWindow != nil && primaryHeaderLines != t.headerWindow.Height()) ||2483+ t.headerLinesShape.Visible() && (t.headerLinesWindow == nil && t.headerLines > 0 || t.headerLinesWindow != nil && t.headerLines != t.headerLinesWindow.Height()) {2484 t.resizeWindows(false, true)2485 t.printList()2486 t.printPrompt()2487 t.printInfo()2488 t.printPreview()2489 }2490+ if !t.headerVisible {2491+ return2492+ }2493+2394- t.withWindow(t.headerWindow, func() { t.printHeaderImpl() })2494+ t.withWindow(t.headerWindow, func() {2495+ var lines []string2496+ if !t.headerLinesShape.Visible() {2497+ lines = t.header2498+ }2499+ t.printHeaderImpl(t.headerWindow, t.headerBorderShape, t.header0, lines)2500+ })2501+ if t.headerLinesShape.Visible() {2502+ t.withWindow(t.headerLinesWindow, func() {2503+ t.printHeaderImpl(t.headerLinesWindow, t.headerLinesShape, nil, t.header)2504+ })2505+ }2506 }2507 2397-func (t *Terminal) printHeaderImpl() {2398- if t.visibleHeaderLines() == 0 {2399- return2508+func (t *Terminal) headerIndent(borderShape tui.BorderShape) int {2509+ indentSize := t.pointerLen + t.markerLen2510+ if t.listBorderShape.HasLeft() {2511+ indentSize += 1 + t.borderWidth2512 }2513+ if borderShape.HasLeft() {2514+ indentSize -= 1 + t.borderWidth2515+ }2516+ return indentSize2517+}2518+2519+func (t *Terminal) printHeaderImpl(window tui.Window, borderShape tui.BorderShape, lines1 []string, lines2 []string) {2520 max := t.window.Height()2402- if t.inputWindow == nil && t.headerWindow == nil && t.headerFirst {2521+ if t.inputWindow == nil && window == nil && t.headerFirst {2522 max--2523 if !t.noSeparatorLine() {2524 max--2525 }11 unmodified lines2537 // fzf --header-lines 3 --style full --no-list-border2538 // fzf --header-lines 3 --style full --no-header-border2539 // fzf --header-lines 3 --style full --no-header-border --no-input-border2540 indentSize := t.pointerLen + t.markerLen2422- if t.headerWindow != nil {2423- if t.listBorderShape.HasLeft() {2424- indentSize += 1 + t.borderWidth2425- }2426- if t.headerBorderShape.HasLeft() {2427- indentSize -= 1 + t.borderWidth2428- }2541+ if window != nil {2542+ indentSize = t.headerIndent(borderShape)2543 }2544 indent := strings.Repeat(" ", indentSize)2545 t.wrap = false2432- for idx, lineStr := range append(append([]string{}, t.header0...), t.header...) {2546+ for idx, lineStr := range append(append([]string{}, lines1...), lines2...) {2547 line := idx2434- if needReverse && idx < len(t.header0) {2435- line = len(t.header0) - idx - 12548+ if needReverse && idx < len(lines1) {2549+ line = len(lines1) - idx - 12550 }2437- if t.inputWindow == nil && t.headerWindow == nil && !t.headerFirst {2551+ if t.inputWindow == nil && window == nil && !t.headerFirst {2552 line++2553 if !t.noSeparatorLine() {2554 line++2555 }973 unmodified lines3529 }3530 if t.headerWindow != nil {3531 windows = append(windows, t.headerWindow)3532 }3533+ if t.headerLinesBorder != nil {3534+ windows = append(windows, t.headerLinesBorder)3535+ }3536+ if t.headerLinesWindow != nil {3537+ windows = append(windows, t.headerLinesWindow)3538+ }3539 if t.inputBorder != nil {3540 windows = append(windows, t.inputBorder)3541 }3542 if t.inputWindow != nil {1930 unmodified lines5473 // Inside the header window5474 // TODO: Should we trigger this on mouse up instead?5475 // Should we still trigger it when the position has changed from the down event?5476 if t.headerVisible && t.headerWindow != nil && t.headerWindow.Enclose(my, mx) {5357- mx -= t.headerWindow.Left() + t.pointerLen + t.markerLen5477+ mx -= t.headerWindow.Left() + t.headerIndent(t.headerBorderShape)5478 my -= t.headerWindow.Top()5479 if mx < 0 {5480 break5481 }5482 t.clickHeaderLine = my + 15483+ if t.layout != layoutReverse && t.headerLinesWindow != nil {5484+ t.clickHeaderLine += t.headerLines5485+ }5486 t.clickHeaderColumn = mx + 15487 return doActions(actionsFor(tui.ClickHeader))5488 }5489 5490+ if t.headerVisible && t.headerLinesWindow != nil && t.headerLinesWindow.Enclose(my, mx) {5491+ mx -= t.headerLinesWindow.Left() + t.headerIndent(t.headerLinesShape)5492+ my -= t.headerLinesWindow.Top()5493+ if mx < 0 {5494+ break5495+ }5496+ t.clickHeaderLine = my + 15497+ if t.layout == layoutReverse {5498+ t.clickHeaderLine += len(t.header0)5499+ }5500+ t.clickHeaderColumn = mx + 15501+ return doActions(actionsFor(tui.ClickHeader))5502+ }5503+5504 // Ignored5505 if !t.window.Enclose(my, mx) && !barDragging {5506 break5507 }489 unmodified linesmodified:test/test_go.rb+186 added-12 removed
3598 unmodified lines3599 BLOCK3600 tmux.until { assert_block(block, _1) }3601 end3602 3603+ def test_header_border_toggle3604+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()'), :Enter3605+ block1 = <<~BLOCK3606+ │ 53607+ │ 43608+ │ 33609+ │ 23610+ │ > 13611+ │ 100/100 ─3612+ │ >3613+ ╰────────────3614+ BLOCK3615+ tmux.until { assert_block(block1, _1) }3616+3617+ tmux.send_keys :Space3618+ block2 = <<~BLOCK3619+ │ 33620+ │ 23621+ │ > 13622+ ╰────────────3623+ ╭────────────3624+ │ hello3625+ ╰────────────3626+ 100/100 ─3627+ >3628+ BLOCK3629+ tmux.until { assert_block(block2, _1) }3630+3631+ tmux.send_keys :Enter3632+ tmux.until { assert_block(block1, _1) }3633+ end3634+3635+ def test_header_border_toggle_with_header_lines3636+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2), :Enter3637+ block1 = <<~BLOCK3638+ │ 53639+ │ 43640+ │ > 33641+ ╰──────────3642+ ╭──────────3643+ │ 23644+ │ 13645+ ╰──────────3646+ 98/98 ─3647+ >3648+ BLOCK3649+ tmux.until { assert_block(block1, _1) }3650+3651+ tmux.send_keys :Space3652+ block2 = <<~BLOCK3653+ │ 43654+ │ > 33655+ ╰──────────3656+ ╭──────────3657+ │ 23658+ │ 13659+ │ hello3660+ ╰──────────3661+ 98/98 ─3662+ >3663+ BLOCK3664+ tmux.until { assert_block(block2, _1) }3665+3666+ tmux.send_keys :Enter3667+ tmux.until { assert_block(block1, _1) }3668+ end3669+3670+ def test_header_border_toggle_with_header_lines_header_first3671+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2 --header-first), :Enter3672+ block1 = <<~BLOCK3673+ │ 53674+ │ 43675+ │ > 33676+ ╰──────────3677+ 98/98 ─3678+ >3679+ ╭──────────3680+ │ 23681+ │ 13682+ ╰──────────3683+ BLOCK3684+ tmux.until { assert_block(block1, _1) }3685+3686+ tmux.send_keys :Space3687+ block2 = <<~BLOCK3688+ │ 43689+ │ > 33690+ ╰──────────3691+ 98/98 ─3692+ >3693+ ╭──────────3694+ │ 23695+ │ 13696+ │ hello3697+ ╰──────────3698+ BLOCK3699+ tmux.until { assert_block(block2, _1) }3700+3701+ tmux.send_keys :Enter3702+ tmux.until { assert_block(block1, _1) }3703+ end3704+3705+ def test_header_border_toggle_with_header_lines_header_lines_border3706+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2 --header-lines-border double), :Enter3707+ block1 = <<~BLOCK3708+ │ 53709+ │ 43710+ │ > 33711+ ╰──────────3712+ ╔══════════3713+ ║ 23714+ ║ 13715+ ╚══════════3716+ 98/98 ─3717+ >3718+ BLOCK3719+ tmux.until { assert_block(block1, _1) }3720+3721+ tmux.send_keys :Space3722+ block2 = <<~BLOCK3723+ │ > 33724+ ╰──────────3725+ ╔══════════3726+ ║ 23727+ ║ 13728+ ╚══════════3729+ ╭──────────3730+ │ hello3731+ ╰──────────3732+ 98/98 ─3733+ >3734+ BLOCK3735+ tmux.until { assert_block(block2, _1) }3736+3737+ tmux.send_keys :Enter3738+ tmux.until { assert_block(block1, _1) }3739+ end3740+3741+ def test_header_border_toggle_with_header_lines_header_first_header_lines_border3742+ tmux.send_keys %(seq 100 | #{FZF} --list-border rounded --header-border rounded --bind 'space:change-header(hello),enter:change-header()' --header-lines 2 --header-first --header-lines-border double), :Enter3743+ block1 = <<~BLOCK3744+ │ 53745+ │ 43746+ │ > 33747+ ╰──────────3748+ ╔══════════3749+ ║ 23750+ ║ 13751+ ╚══════════3752+ 98/98 ─3753+ >3754+ BLOCK3755+ tmux.until { assert_block(block1, _1) }3756+3757+ tmux.send_keys :Space3758+ block2 = <<~BLOCK3759+ │ > 33760+ ╰──────────3761+ ╔══════════3762+ ║ 23763+ ║ 13764+ ╚══════════3765+ 98/98 ─3766+ >3767+ ╭──────────3768+ │ hello3769+ ╰──────────3770+ BLOCK3771+ tmux.until { assert_block(block2, _1) }3772+3773+ tmux.send_keys :Enter3774+ tmux.until { assert_block(block1, _1) }3775+ end3776+3777 def test_header_border_and_label_header_first3778 tmux.send_keys %(seq 100 | #{FZF} --border rounded --header-lines 3 --header-border sharp --header-label header --header-label-pos 2:bottom --query 1 --padding 1,2 --header-first), :Enter3779 block = <<~BLOCK3780 │ 1217 unmodified lines3798 block = <<~BLOCK3799 │ ║ 123800 │ ║ 113801 │ ║ > 103628- │ ╚list════3629- │ ┌────────3802+ │ ╚list══════3803+ │ ┌──────────3804 │ │ 33805 │ │ 23806 │ │ 13633- │ └header──3634- │ 19/97 ─3635- │ > 13807+ │ └header────3808+ │ 19/97 ─3809+ │ > 13810 │3637- ╰────────────3811+ ╰──────────────3812 BLOCK3813 tmux.until { assert_block(block, _1) }3814 end3815 2 unmodified lines3818 block = <<~BLOCK3819 │ ║ 123820 │ ║ 113821 │ ║ > 103648- │ ╚list════3649- │ 19/97 ─3650- │ > 13651- │ ┌────────3822+ │ ╚list══════3823+ │ 19/97 ─3824+ │ > 13825+ │ ┌──────────3826 │ │ 33827 │ │ 23828 │ │ 13655- │ └header──3829+ │ └header────3830 │3657- ╰────────────3831+ ╰──────────────3832 BLOCK3833 tmux.until { assert_block(block, _1) }3834 end3835 662 unmodified lines