author | Matt Mackall <mpm@selenic.com> |
Wed, 21 Sep 2011 13:00:46 -0500 | |
changeset 15143 | 16c129b0f465 |
parent 15142 | 176882876780 |
child 15144 | 87bb975a1844 |
--- a/mercurial/encoding.py Wed Sep 21 13:00:41 2011 -0500 +++ b/mercurial/encoding.py Wed Sep 21 13:00:46 2011 -0500 @@ -149,6 +149,14 @@ return sum([eaw(c) in wide and 2 or 1 for c in d]) return len(d) +def getcols(s, start, c): + '''Use colwidth to find a c-column substring of s starting at byte + index start''' + for x in xrange(start + c, len(s)): + t = s[start:x] + if colwidth(t) == c: + return t + def lower(s): "best-effort encoding-aware case-folding of local string s" try: