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):
4444 creating specialized objects from Nvim remote handles.
4545 """
4646 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 )
4851
4952 if IS_PYTHON3 :
5053 hook = DecodeHook ()
Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ def __init__(self, event_loop):
2121 """Wrap `event_loop` on a msgpack-aware interface."""
2222 self ._event_loop = event_loop
2323 self ._posted = deque ()
24- self ._packer = Packer (use_bin_type = True )
24+ self ._packer = Packer (use_bin_type = True , encoding = None )
2525 self ._unpacker = Unpacker ()
2626 self ._message_cb = None
2727 self ._stopped = False
2828
29+ def set_packer_encoding (self , encoding ):
30+ """Switch encoding for Unicode strings."""
31+ self ._packer = Packer (use_bin_type = True , encoding = encoding )
32+
2933 def post (self , msg ):
3034 """Post `msg` to the read queue of the `MsgpackStream` instance.
3135
You can’t perform that action at this time.
0 commit comments