diff --git a/pynvim/plugin/script_host.py b/pynvim/plugin/script_host.py index 36893176..1efb9457 100644 --- a/pynvim/plugin/script_host.py +++ b/pynvim/plugin/script_host.py @@ -194,7 +194,7 @@ def writelines(self, seq): def num_to_str(obj): - if isinstance(obj, num_types): + if isinstance(obj, num_types) and not isinstance(obj, bool): return str(obj) else: return obj diff --git a/test/test_host.py b/test/test_host.py index b21a398b..92de91fe 100644 --- a/test/test_host.py +++ b/test/test_host.py @@ -28,3 +28,10 @@ def test_host_async_error(vim): assert event[1] == 'nvim_error_event' assert 'rplugin-host: Async request caused an error:\nboom\n' \ in h._on_error_event(None, 'boom') + +def test_legacy_vim_eval(vim): + h = ScriptHost(vim) + assert h.legacy_vim.eval('1') == '1' + assert h.legacy_vim.eval('v:null') == None + assert h.legacy_vim.eval('v:true') == True + assert h.legacy_vim.eval('v:false') == False