equal
deleted
inserted
replaced
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 |