Skip to content

Commit c48dd01

Browse files
committed
Fix printing of header when NUL byte is in the list
NUL byte is 0, and header also got added as 0: so it would sometimes sort after the NUL byte. rune is int32, so can add header as -1, ensuring it's always on top.
1 parent 31dd760 commit c48dd01

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
- Fix sorting of `print` and `search` with a custom `-format` flag which didn't
44
include `%(dec)`.
55

6+
- Sometimes the would be printed on the second line instead of the first when
7+
printing everything or control characters.
8+
69
- Recognize `c:[cat-name]` to print a category.
710

811
### v2.8.0 (2024-09-11)

format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func NewFormat(format string, as printAs, knownCols ...string) (*Format, error)
138138
h["tab"] = tabOrSpace()
139139

140140
if as == printAsList {
141-
f.Line(0, h)
141+
f.Line(-1, h)
142142
}
143143

144144
// TODO: is this actually faster than just .*?

0 commit comments

Comments
 (0)