Skip to content

Commit e1676d3

Browse files
committed
Use wcwidth where it makes sense
1 parent 43eeee4 commit e1676d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

curtsies/formatstring.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import itertools
4242
import re
4343
import sys
44-
from cwcwidth import wcswidth
44+
from cwcwidth import wcswidth, wcwidth
4545

4646
from .escseqparse import parse, remove_ansi
4747
from .termformatconstants import (
@@ -235,7 +235,7 @@ def __init__(self, chunk):
235235
self.internal_width = 0 # width of chunks.s[:self.internal_offset]
236236
divides = [0]
237237
for c in self.chunk.s:
238-
divides.append(divides[-1] + wcswidth(c))
238+
divides.append(divides[-1] + wcwidth(c))
239239
self.divides = divides
240240

241241
def reinit(self, chunk):
@@ -790,7 +790,7 @@ def width_aware_slice(s, start, end, replacement_char=" "):
790790
"""
791791
divides = [0]
792792
for c in s:
793-
divides.append(divides[-1] + wcswidth(c))
793+
divides.append(divides[-1] + wcwidth(c))
794794

795795
new_chunk_chars = []
796796
for char, char_start, char_end in zip(s, divides[:-1], divides[1:]):

0 commit comments

Comments
 (0)