From ce2379bb549af83bc8a635d50b01215c649f1764 Mon Sep 17 00:00:00 2001 From: Noboru Saito Date: Wed, 15 Mar 2023 11:31:51 +0900 Subject: [PATCH] Fixed a mistake that was not advancing the pointer --- guesswidth.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guesswidth.go b/guesswidth.go index b308740..14c5aca 100644 --- a/guesswidth.go +++ b/guesswidth.go @@ -179,14 +179,14 @@ func split(line string, pos []int, trimSpace bool) []string { break } if pos[n] == p { - end := separatorPosition(lr, p, pos, n) + p = separatorPosition(lr, p, pos, n) if trimSpace { - columns[n] = strings.TrimSpace(string(lr[start:end])) + columns[n] = strings.TrimSpace(string(lr[start:p])) } else { - columns[n] = string(lr[start:end]) + columns[n] = string(lr[start:p]) } n++ - start = end + start = p } if runewidth.RuneWidth(lr[p]) == 2 { p++