diff options
author | hut <hut@lavabit.com> | 2010-12-21 22:30:32 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-12-21 22:30:32 +0100 |
commit | a5cd2deeb4cda0ab941365cbd207115cc27f8f3e (patch) | |
tree | c79e637e99722a5a78858be8985be51028610c39 /ranger/ext/utfwidth.py | |
parent | 32944f0554eafe0b091967a7669bf25d704f68bb (diff) | |
download | ranger-a5cd2deeb4cda0ab941365cbd207115cc27f8f3e.tar.gz |
widgets.console: Fixed position of cursor with unicode chars (py3)
Diffstat (limited to 'ranger/ext/utfwidth.py')
-rw-r--r-- | ranger/ext/utfwidth.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ranger/ext/utfwidth.py b/ranger/ext/utfwidth.py index a506c676..0976fee1 100644 --- a/ranger/ext/utfwidth.py +++ b/ranger/ext/utfwidth.py @@ -58,9 +58,13 @@ def utf_byte_length(string): return 4 return 1 # invalid + def utf_char_width(string): """Return the width of a single character""" u = _utf_char_to_int(string) + return utf_char_width_(u) + +def utf_char_width_(u): if u < 0x1100: return NARROW # Hangul Jamo init. constonants |