Skip to content

Commit b54e04d

Browse files
paul-lalondeplalonde-nvidiarjkroege
authored
Fix rune count in X, x event messages (#490)
Co-authored-by: Paul Lalonde <[email protected]> Co-authored-by: Robert Kroeger <[email protected]>
1 parent 73ec48e commit b54e04d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exec.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"strconv"
1414
"strings"
1515
"time"
16+
"unicode/utf8"
1617

1718
"9fans.net/go/plan9"
1819
"9fans.net/go/plan9/client"
@@ -223,9 +224,9 @@ func execute(t *Text, aq0 int, aq1 int, external bool, argt *Text) {
223224
}
224225
}
225226
if a != "" {
226-
t.w.Eventf("%c0 0 0 %d %v\n", c, len(a), a)
227+
t.w.Eventf("%c0 0 0 %d %v\n", c, utf8.RuneCountInString(a), a)
227228
if aa != "" {
228-
t.w.Eventf("%c0 0 0 %d %v\n", c, len(aa), aa)
229+
t.w.Eventf("%c0 0 0 %d %v\n", c, utf8.RuneCountInString(aa), aa)
229230
} else {
230231
t.w.Eventf("%c0 0 0 0 \n", c)
231232
}

0 commit comments

Comments
 (0)