##// END OF EJS Templates
encoding: make sure "wide" variable never be referenced from other modules...
Yuya Nishihara -
r32537:044f3d7e default
parent child Browse files
Show More
@@ -194,7 +194,7 b' if not _nativeenviron:'
194 194 for k, v in os.environ.items()) # re-exports
195 195
196 196 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
197 wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
197 _wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
198 198 and "WFA" or "WF")
199 199
200 200 def colwidth(s):
@@ -205,7 +205,7 b' def ucolwidth(d):'
205 205 "Find the column width of a Unicode string for display"
206 206 eaw = getattr(unicodedata, 'east_asian_width', None)
207 207 if eaw is not None:
208 return sum([eaw(c) in wide and 2 or 1 for c in d])
208 return sum([eaw(c) in _wide and 2 or 1 for c in d])
209 209 return len(d)
210 210
211 211 def getcols(s, start, c):
General Comments 0
You need to be logged in to leave comments. Login now