aboutsummaryrefslogtreecommitdiff
path: root/cmd/krino/render.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/krino/render.go')
-rw-r--r--cmd/krino/render.go9
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() {