Skip to content
Myr

Remove header indentation when unnecessary

Before adoption: this commit came in with the history the project adopted, so no landing records it.

# Indent the header to align with the entries in the list fzf --header 'Hello' --header-border --list-border # No extra indentation required fzf --header 'Hello' --header-border

authored by Junegunn Choi · committed by Junegunn Choi · parent 5ae60e2 · Browse files · 2 files+11 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−7 removed

  • tests:+6 added−6 removed
  • other:+5 added−1 removed

2 files+11 added−7 removed

modified:src/terminal.go+5 added-1 removed
2384 unmodified lines
2385 needReverse = true2386 }2387 // Wrapping is not supported for header2388 wrap := t.wrap2389 indent := strings.Repeat(" ", t.pointerLen+t.markerLen)2389 indentSize := t.pointerLen + t.markerLen2390 if t.headerBorderShape.HasLeft() && !t.listBorderShape.HasLeft() {2391 indentSize = util.Max(0, indentSize-(1+t.borderWidth))2392 }2393 indent := strings.Repeat(" ", indentSize)2394 t.wrap = false2395 for idx, lineStr := range append(append([]string{}, t.header0...), t.header...) {2396 line := idx2397 if needReverse && idx < len(t.header0) {
3351 unmodified lines
modified:test/test_go.rb+6 added-6 removed
3586 unmodified lines
3587 │ 123588 │ 113589 │ > 103590 │ ┌────────3591 │ │ 33592 │ │ 23593 │ │ 13591 │ │ 33592 │ │ 23593 │ │ 13594 │ └header──3595 │ 19/97 ─3596 │ > 13597 │
10 unmodified lines
3608 │ > 103609 │ 19/97 ─3610 │ > 13611 │ ┌────────3612 │ │ 33613 │ │ 23614 │ │ 13612 │ │ 33613 │ │ 23614 │ │ 13615 │ └header──3616 │3617 ╰────────────3618 BLOCK
627 unmodified lines