ref: 0a7455c6a861565d74e3bff9d0cd87bd391db14f
parent: b75af1551d03e829569adcc202cfd68bc0244b2b
author: penny <penny@limitedideas.org>
date: Sun Aug 3 20:09:58 EDT 2025
don't miss short hyphens
--- a/format.go
+++ b/format.go
@@ -10,7 +10,7 @@
width := readline.GetScreenWidth()
result, remainder := hyphenateline(input, width)
var cresult string
- for len([]rune(remainder)) > width {+ for len([]rune(remainder)) > width-1 {cresult, remainder = hyphenateline(remainder, width)
result += cresult
}
@@ -33,7 +33,7 @@
remainder := string([]rune(input)[len([]rune(begin)):])
- if hyphenate == true && begin[width-2] != ' ' {+ if hyphenate == true && string([]rune(begin)[width-2:]) != " " {begin += "-"
}
if len(remainder) > width-1 {--
⑨