Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Commit9410804

Browse files
committed
If patch 8.0.1280 is available, do not convert None.vim/vim#2246
1 parentdefa4e5 commit9410804

File tree

1 file changed

+28
-16
lines changed

1 file changed

+28
-16
lines changed

‎pythonx/neovim_rpc_protocol.py‎

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,34 @@ def walk(fn, obj):
2626
obj.items())
2727
returnfn(obj)
2828

29-
deffrom_client(msg):
30-
31-
defhandler(obj):
32-
iftype(obj)ismsgpack.ExtType:
33-
ifobj.code==BUFFER_TYPE_ID:
34-
returnvim.buffers[msgpack.unpackb(obj.data)]
35-
ifobj.code==WINDOW_TYPE_ID:
36-
returnvim.windows[msgpack.unpackb(obj.data)-1]
37-
elifobjisNone:
38-
return''
39-
ifsys.version_info.major!=2:
40-
# python3 needs decode
41-
obj=decode_if_bytes(obj)
42-
returnobj
43-
44-
returnwalk(handler,msg)
29+
ifvim.eval("has('patch-8.0.1280')"):
30+
deffrom_client(msg):
31+
defhandler(obj):
32+
iftype(obj)ismsgpack.ExtType:
33+
ifobj.code==BUFFER_TYPE_ID:
34+
returnvim.buffers[msgpack.unpackb(obj.data)]
35+
ifobj.code==WINDOW_TYPE_ID:
36+
returnvim.windows[msgpack.unpackb(obj.data)-1]
37+
ifsys.version_info.major!=2:
38+
# python3 needs decode
39+
obj=decode_if_bytes(obj)
40+
returnobj
41+
returnwalk(handler,msg)
42+
else:
43+
deffrom_client(msg):
44+
defhandler(obj):
45+
iftype(obj)ismsgpack.ExtType:
46+
ifobj.code==BUFFER_TYPE_ID:
47+
returnvim.buffers[msgpack.unpackb(obj.data)]
48+
ifobj.code==WINDOW_TYPE_ID:
49+
returnvim.windows[msgpack.unpackb(obj.data)-1]
50+
elifobjisNone:
51+
return''
52+
ifsys.version_info.major!=2:
53+
# python3 needs decode
54+
obj=decode_if_bytes(obj)
55+
returnobj
56+
returnwalk(handler,msg)
4557

4658
defto_client(msg):
4759
defhandler(obj):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp