Fix ANSI offset calculation

pull/242/head 0.9.12
Junegunn Choi 9 years ago
parent 4e0e492427
commit b68e59a24b

@ -50,7 +50,7 @@ func extractColor(str *string) (*string, []ansiOffset) {
if !newState.equals(state) {
if state != nil {
// Update last offset
(&offsets[len(offsets)-1]).offset[1] = int32(output.Len())
(&offsets[len(offsets)-1]).offset[1] = int32(utf8.RuneCount(output.Bytes()))
}
if newState.colored() {

Loading…
Cancel
Save