Skip to content

Commit d7417d0

Browse files
committed
Fix js test
1 parent f6fde07 commit d7417d0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

js/vimlfunc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function viml_keys(obj) {
152152

153153
function viml_len(obj) {
154154
if (typeof obj === 'string') {
155-
return unescape(encodeURIComponent(obj))
155+
return encodeURIComponent(obj).replace(/%../g, ' ').length;
156156
}
157157
return obj.length;
158158
}

js/vimlparser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function viml_keys(obj) {
152152

153153
function viml_len(obj) {
154154
if (typeof obj === 'string') {
155-
return unescape(encodeURIComponent(obj))
155+
return encodeURIComponent(obj).replace(/%../g, ' ').length;
156156
}
157157
return obj.length;
158158
}

0 commit comments

Comments
 (0)