mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
PPRINT, markdown-aligned, and XTAB writers measured column widths with utf8.RuneCountInString, which counts codepoints rather than terminal display columns. East-Asian fullwidth characters (counted as 1 but displayed as 2) and zero-width combining marks (counted as 1 but displayed as 0) both caused misalignment. Add lib.DisplayWidth wrapping uniseg.StringWidth, and use it from the three writers. The XTAB right-aligned path also drops fmt.Sprintf with %*s since Go's %*s pads by rune count too. UTF8Strlen is unchanged so DSL strlen semantics are preserved. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| doc.go | ||
| docurl.go | ||
| file_readers.go | ||
| getoptify.go | ||
| halfpipe.go | ||
| latin1.go | ||
| latin1_test.go | ||
| logger.go | ||
| mlrmath.go | ||
| ordered_map.go | ||
| paragraph.go | ||
| rand.go | ||
| readfiles.go | ||
| README.md | ||
| regex.go | ||
| regex_test.go | ||
| stats.go | ||
| time.go | ||
| time_test.go | ||
| tsv_codec.go | ||
| tsv_codec_test.go | ||
| unbackslash.go | ||
| unbackslash_test.go | ||
| util.go | ||
These are basic library routines for Miller.