Modernize Go code

This commit is contained in:
Kovid Goyal
2026-03-10 14:47:41 +05:30
parent 3d13cf1ca5
commit eddaaed3e3
16 changed files with 64 additions and 87 deletions

View File

@@ -292,13 +292,13 @@ func (h *Handler) draw_num_of_matches(num_shown, y int, in_progress bool) {
st := loop.SizedText{Subscale_denominator: 2, Subscale_numerator: 1, Vertical_alignment: 2, Width: 1}
graphemes := wcswidth.SplitIntoGraphemes(m)
for len(graphemes) > 0 {
s := ""
var s strings.Builder
for w := 0; w < 2 && len(graphemes) > 0; {
w += wcswidth.Stringwidth(graphemes[0])
s += graphemes[0]
s.WriteString(graphemes[0])
graphemes = graphemes[1:]
}
h.lp.DrawSizedText(s, st)
h.lp.DrawSizedText(s.String(), st)
}
if spinner != "" {
h.lp.QueueWriteString(spinner)