aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/msgpack.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload/msgpack.vim')
-rw-r--r--runtime/autoload/msgpack.vim7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/autoload/msgpack.vim b/runtime/autoload/msgpack.vim
index e6022922fe..2e2697c57f 100644
--- a/runtime/autoload/msgpack.vim
+++ b/runtime/autoload/msgpack.vim
@@ -356,6 +356,8 @@ let s:MSGPACK_STANDARD_TYPES = {
\type(''): 'binary',
\type([]): 'array',
\type({}): 'map',
+ \type(v:true): 'boolean',
+ \type(v:null): 'nil',
\}
""
@@ -379,7 +381,7 @@ endfunction
""
" Dump boolean value.
function s:msgpack_dump_boolean(v) abort
- return a:v._VAL ? 'TRUE' : 'FALSE'
+ return (a:v is v:true || (a:v isnot v:false && a:v._VAL)) ? 'TRUE' : 'FALSE'
endfunction
""
@@ -395,7 +397,8 @@ endfunction
""
" Dump floating-point value.
function s:msgpack_dump_float(v) abort
- return string(type(a:v) == type({}) ? a:v._VAL : a:v)
+ return substitute(string(type(a:v) == type({}) ? a:v._VAL : a:v),
+ \'\V\^\(-\)\?str2float(''\(inf\|nan\)'')\$', '\1\2', '')
endfunction
""