mercurial/utils/stringutil.py
changeset 38783 e7aa113b14f7
parent 38576 a3130208db1c
child 39051 2aebe138ef6e
equal deleted inserted replaced
38782:7eba8f83129b 38783:e7aa113b14f7
   462         This requires use decision to determine width of such characters.
   462         This requires use decision to determine width of such characters.
   463         """
   463         """
   464         def _cutdown(self, ucstr, space_left):
   464         def _cutdown(self, ucstr, space_left):
   465             l = 0
   465             l = 0
   466             colwidth = encoding.ucolwidth
   466             colwidth = encoding.ucolwidth
   467             for i in xrange(len(ucstr)):
   467             for i in pycompat.xrange(len(ucstr)):
   468                 l += colwidth(ucstr[i])
   468                 l += colwidth(ucstr[i])
   469                 if space_left < l:
   469                 if space_left < l:
   470                     return (ucstr[:i], ucstr[i:])
   470                     return (ucstr[:i], ucstr[i:])
   471             return ucstr, ''
   471             return ucstr, ''
   472 
   472