Fix --no-header-lines-border behavior
Before adoption: this commit came in with the history the project adopted, so no landing records it.
It should be different from --header-lines-border=none according to the man page. It should merge two headers unlike the latter.
authored by Junegunn Choi · committed by Junegunn Choi · parent ead3029 · Browse files · 2 files·+21 added−19 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+21 added−19 removed
- tests:+20 added−18 removed
- other:+1 added−1 removed
Provenance
- Commit
08027e7- Tree
abfe0a9- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
ead3029
2 files changed+21 added−19 removed
modified:src/options.go+1 added-1 removed
2922 unmodified lines2923 if opts.HeaderBorderShape, err = parseBorder(arg, !hasArg); err != nil {2924 return err2925 }2926 case "--no-header-lines-border":2927- opts.HeaderLinesShape = tui.BorderNone2927+ opts.HeaderLinesShape = tui.BorderUndefined2928 case "--header-lines-border":2929 hasArg, arg := optionalNextString()2930 if opts.HeaderLinesShape, err = parseBorder(arg, !hasArg); err != nil {2931 return err685 unmodified linesmodified:test/test_layout.rb+20 added-18 removed
993 unmodified lines994 %[--header "$(seq 101 102)" --header-lines 2 --header-first],995 %[--header "$(seq 101 102)" --header-border sharp],996 %[--header "$(seq 101 102)" --header-border sharp --header-first],997 %[--header "$(seq 101 102)" --header-border sharp --header-lines 2],998+ %[--header "$(seq 101 102)" --header-border sharp --header-lines 2 --no-header-lines-border],999+ %[--header "$(seq 101 102)" --header-border sharp --header-lines 2 --header-lines-border none],1000 %[--header "$(seq 101 102)" --header-border sharp --header-lines 2 --header-lines-border sharp],1001 %[--header "$(seq 101 102)" --header-border sharp --header-lines 2 --header-lines-border sharp --header-first --input-border sharp],1002 %[--header "$(seq 101 102)" --header-border sharp --header-lines 2 --header-lines-border sharp --header-first --no-input],1003 %[--header "$(seq 101 102)" --footer-border sharp --input-border line],1004 %[--header "$(seq 101 102)" --style full:sharp --header-first]1005 ]1006 output = <<~BLOCK1005- ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌───────── ┌──────── ┌──────── ┌─────────1006- │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ ┌─FOOT─ │ ┌─FOOT──1007- │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ │ 201 │ │ 2011008- │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT── │ ──FOOT─ │ │ 202 │ │ 2021009- │ 3 │ 3 │ 3 │ > 3 │ > 3 │ 3 │ 3 │ > 3 │ > 3 │ > 3 │ > 3 │ └────── │ └───────1010- │ 2 │ 2 │ 2 │ 2 │ 2 │ 2 │ 2 │ ┌────── │ ┌────── │ ┌─────── │ ┌────── │ 3 │ ┌───────1011- │ > 1 │ > 1 │ > 1 │ 1 │ 1 │ > 1 │ > 1 │ │ 2 │ │ 2 │ │ 2 │ │ 2 │ 2 │ │ 31012- │ 3/3 ─ │ 101 │ 3/3 ─ │ 101 │ 1/1 ─ │ ┌────── │ 3/3 ─ │ │ 1 │ │ 1 │ │ 1 │ │ 1 │ > 1 │ │ 21013- │ > │ 102 │ > │ 102 │ > │ │ 101 │ > │ │ 101 │ └────── │ └─────── │ └────── │ 101 │ │ > 11014- └──────── │ 3/3 ─ │ 101 │ 1/1 ─ │ 101 │ │ 102 │ ┌────── │ │ 102 │ ┌────── │ ┌─────── │ ┌────── │ 102 │ └───────1015- │ > │ 102 │ > │ 102 │ └─HEAD─ │ │ 101 │ └─HEAD─ │ │ 101 │ │ 1/1 │ │ 101 │ ─────── │ ┌───────1016- └──────── └──────── └──────── └──────── │ 3/3 ─ │ │ 102 │ 1/1 ─ │ │ 102 │ │ > │ │ 102 │ 3/3 │ │ >1017- │ > │ └─HEAD─ │ > │ └─HEAD─ │ └─────── │ └─HEAD─ │ > │ └───────1018- └──────── └──────── └──────── │ 1/1 ─ │ ┌─────── └──────── └──────── │ ┌───────1019- │ > │ │ 101 │ │ 1011020- └──────── │ │ 102 │ │ 1021021- │ └─HEAD── │ └─HEAD──1022- └───────── └─────────1007+ ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌──────── ┌───────── ┌──────── ┌──────── ┌─────────1008+ │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ 201 │ ┌─FOOT─ │ ┌─FOOT──1009+ │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ 202 │ │ 201 │ │ 2011010+ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT─ │ ──FOOT── │ ──FOOT─ │ │ 202 │ │ 2021011+ │ 3 │ 3 │ 3 │ > 3 │ > 3 │ 3 │ 3 │ > 3 │ > 3 │ > 3 │ > 3 │ > 3 │ > 3 │ └────── │ └───────1012+ │ 2 │ 2 │ 2 │ 2 │ 2 │ 2 │ 2 │ ┌────── │ ┌────── │ 2 │ ┌────── │ ┌─────── │ ┌────── │ 3 │ ┌───────1013+ │ > 1 │ > 1 │ > 1 │ 1 │ 1 │ > 1 │ > 1 │ │ 2 │ │ 2 │ 1 │ │ 2 │ │ 2 │ │ 2 │ 2 │ │ 31014+ │ 3/3 ─ │ 101 │ 3/3 ─ │ 101 │ 1/1 ─ │ ┌────── │ 3/3 ─ │ │ 1 │ │ 1 │ ┌────── │ │ 1 │ │ 1 │ │ 1 │ > 1 │ │ 21015+ │ > │ 102 │ > │ 102 │ > │ │ 101 │ > │ │ 101 │ │ 101 │ │ 101 │ └────── │ └─────── │ └────── │ 101 │ │ > 11016+ └──────── │ 3/3 ─ │ 101 │ 1/1 ─ │ 101 │ │ 102 │ ┌────── │ │ 102 │ │ 102 │ │ 102 │ ┌────── │ ┌─────── │ ┌────── │ 102 │ └───────1017+ │ > │ 102 │ > │ 102 │ └─HEAD─ │ │ 101 │ └─HEAD─ │ └─HEAD─ │ └─HEAD─ │ │ 101 │ │ 1/1 │ │ 101 │ ─────── │ ┌───────1018+ └──────── └──────── └──────── └──────── │ 3/3 ─ │ │ 102 │ 1/1 ─ │ 1/1 ─ │ 1/1 ─ │ │ 102 │ │ > │ │ 102 │ 3/3 │ │ >1019+ │ > │ └─HEAD─ │ > │ > │ > │ └─HEAD─ │ └─────── │ └─HEAD─ │ > │ └───────1020+ └──────── └──────── └──────── └──────── └──────── │ 1/1 ─ │ ┌─────── └──────── └──────── │ ┌───────1021+ │ > │ │ 101 │ │ 1011022+ └──────── │ │ 102 │ │ 1021023+ │ └─HEAD── │ └─HEAD──1024+ └───────── └─────────1025 BLOCK1026 1027 expects = []1028 output.each_line.first.scan(/\S+/) do205 unmodified lines