diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-15 00:29:09 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-15 00:29:09 +0200 |
| commit | 17e933a16ff7de1b06d62504e78c40e615c8b553 (patch) | |
| tree | 0ceb58ff18f9ee6f35fbcb6255c8a830e6124b84 /cmd/krino/render.go | |
| parent | 59015f1f91d640502fdfc34019cf0154b5206bb8 (diff) | |
| download | krino-17e933a16ff7de1b06d62504e78c40e615c8b553.tar.gz krino-17e933a16ff7de1b06d62504e78c40e615c8b553.zip | |
review and undo headings wrap past the label column; format characters take a column
Diffstat (limited to 'cmd/krino/render.go')
| -rw-r--r-- | cmd/krino/render.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/krino/render.go b/cmd/krino/render.go index 7205488..5b75df3 100644 --- a/cmd/krino/render.go +++ b/cmd/krino/render.go @@ -325,8 +325,11 @@ func wrapText(s string, max int) []string { } // cols is how many terminal columns s takes: two for a wide or full-width -// character (CJK), none for a combining mark or format character, one for -// the rest (triage 28j). +// character (CJK), none for a combining mark, one for the rest - format +// characters included: a terminal may draw one (a soft hyphen), and +// counting a column too many only wraps early, while one too few runs past +// the edge (triage 28j, plan 11 review L4). A terminal can still draw some +// characters wider (emoji, ambiguous-width letters); see KNOWN LIMITATIONS. func cols(s string) int { n := 0 for _, r := range s { @@ -336,7 +339,7 @@ func cols(s string) int { } func runeCols(r rune) int { - if unicode.In(r, unicode.Mn, unicode.Me, unicode.Cf) { + if unicode.In(r, unicode.Mn, unicode.Me) { return 0 } switch width.LookupRune(r).Kind() { |
