File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,10 @@ def from_session(cls, session):
44
44
creating specialized objects from Nvim remote handles.
45
45
"""
46
46
session .error_wrapper = lambda e : NvimError (e [1 ])
47
- channel_id , metadata = session .request ('vim_get_api_info' )
47
+ channel_id , metadata = session .request (b'vim_get_api_info' )
48
+
49
+ encoding = session .request (b'vim_get_option' , b'encoding' )
50
+ session ._async_session ._msgpack_stream .set_packer_encoding (encoding )
48
51
49
52
if IS_PYTHON3 :
50
53
hook = DecodeHook ()
Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ def __init__(self, event_loop):
21
21
"""Wrap `event_loop` on a msgpack-aware interface."""
22
22
self ._event_loop = event_loop
23
23
self ._posted = deque ()
24
- self ._packer = Packer (use_bin_type = True )
24
+ self ._packer = Packer (use_bin_type = True , encoding = None )
25
25
self ._unpacker = Unpacker ()
26
26
self ._message_cb = None
27
27
self ._stopped = False
28
28
29
+ def set_packer_encoding (self , encoding ):
30
+ """Switch encoding for Unicode strings."""
31
+ self ._packer = Packer (use_bin_type = True , encoding = encoding )
32
+
29
33
def post (self , msg ):
30
34
"""Post `msg` to the read queue of the `MsgpackStream` instance.
31
35
You can’t perform that action at this time.
0 commit comments