Skip to content

Commit

Permalink
Fixed a mistake that was not advancing the pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
noborus committed Mar 15, 2023
1 parent 7d1585b commit ce2379b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guesswidth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down

0 comments on commit ce2379b

Please sign in to comment.