Skip to content

Commit 4fc927b

Browse files
committed
Fix order to replace
1 parent b2dee98 commit 4fc927b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

autoload/webapi/json.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ function! webapi#json#encode(val)
106106
return a:val
107107
elseif type(a:val) == 1
108108
let json = '"' . escape(a:val, '\"') . '"'
109-
let json = substitute(json, '\([[:cntrl:]]\)', '\=printf("\x%02d", char2nr(submatch(1)))', 'g')
110109
let json = substitute(json, "\r", '\\r', 'g')
111110
let json = substitute(json, "\n", '\\n', 'g')
112111
let json = substitute(json, "\t", '\\t', 'g')
112+
let json = substitute(json, '\([[:cntrl:]]\)', '\=printf("\x%02d", char2nr(submatch(1)))', 'g')
113113
return iconv(json, &encoding, "utf-8")
114114
elseif type(a:val) == 2
115115
let s = string(a:val)

0 commit comments

Comments
 (0)