Skip to content

Commit 7b2fa35

Browse files
committed
fix viml_len implementation in Python
1 parent 92d542b commit 7b2fa35

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

py/vimlfunc.py

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def viml_keys(obj):
128128
return obj.keys()
129129

130130
def viml_len(obj):
131+
if type(obj) is str:
132+
return len(obj.encode('utf-8'))
131133
return len(obj)
132134

133135
def viml_printf(*args):

py/vimlparser.py

+2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ def viml_keys(obj):
128128
return obj.keys()
129129

130130
def viml_len(obj):
131+
if type(obj) is str:
132+
return len(obj.encode('utf-8'))
131133
return len(obj)
132134

133135
def viml_printf(*args):

0 commit comments

Comments
 (0)