File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ def __init__(self, nvim):
43
43
exec ('import sys' , self .module .__dict__ )
44
44
self .legacy_vim = LegacyVim .from_nvim (nvim )
45
45
sys .modules ['vim' ] = self .legacy_vim
46
-
46
+ # mimic Vim by importing vim module by default.
47
+ exec ('import vim' , self .module .__dict__ )
47
48
# Handle DirChanged. #296
48
49
nvim .command (
49
50
'au DirChanged * call rpcnotify({}, "python_chdir", v:event.cwd)'
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
-
3
2
from pynvim .plugin .host import Host , host_method_spec
3
+ from pynvim .plugin .script_host import ScriptHost
4
+
5
+
6
+ def test_host_imports (vim ):
7
+ h = ScriptHost (vim )
8
+ assert h .module .__dict__ ['vim' ]
9
+ assert h .module .__dict__ ['vim' ] == h .legacy_vim
10
+ assert h .module .__dict__ ['sys' ]
4
11
5
12
6
13
def test_host_clientinfo (vim ):
You can’t perform that action at this time.
0 commit comments