Mercurial > vim
diff src/if_py_both.h @ 7712:bce3b5ddb393 v7.4.1154
commit https://github.com/vim/vim/commit/520e1e41f35b063ede63b41738c82d6636e78c34
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 23 19:46:28 2016 +0100
patch 7.4.1154
Problem: No support for JSON.
Solution: Add jsonencode() and jsondecode(). Also add v:false, v:true,
v:null and v:none.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Jan 2016 20:00:04 +0100 |
parents | 066ef357ea91 |
children | 3f7382858d4d |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -810,6 +810,25 @@ VimToPython(typval_T *our_tv, int depth, } } } + else if (our_tv->v_type == VAR_SPECIAL) + { + if (our_tv->vval.v_number == VVAL_FALSE) + { + ret = Py_False; + Py_INCREF(ret); + } + else if (our_tv->vval.v_number == VVAL_TRUE) + { + ret = Py_True; + Py_INCREF(ret); + } + else + { + Py_INCREF(Py_None); + ret = Py_None; + } + return ret; + } else { Py_INCREF(Py_None);