mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-08 19:44:52 +08:00
changed something that I absolutely don't get again. #48
This commit is contained in:
@@ -22,8 +22,11 @@ class PythonToVimStr(encoding):
|
|||||||
__slots__ = []
|
__slots__ = []
|
||||||
|
|
||||||
def __new__(cls, s):
|
def __new__(cls, s):
|
||||||
# VIM doesn't like UTF-8
|
# Somehow I'm not getting anything unicode related in Python
|
||||||
s = s.decode('latin-1')
|
try:
|
||||||
|
s = s.decode('utf-8')
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
s = unicode(s, 'latin-1')
|
||||||
return super(PythonToVimStr, cls).__new__(cls, s)
|
return super(PythonToVimStr, cls).__new__(cls, s)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
@@ -80,8 +83,8 @@ def complete():
|
|||||||
|
|
||||||
out = []
|
out = []
|
||||||
for c in completions:
|
for c in completions:
|
||||||
d = dict(word=c.word[:len(base)] + c.complete,
|
d = dict(word=PythonToVimStr(c.word[:len(base)] + c.complete),
|
||||||
abbr=c.word,
|
abbr=PythonToVimStr(c.word),
|
||||||
# stuff directly behind the completion
|
# stuff directly behind the completion
|
||||||
menu=PythonToVimStr(c.description),
|
menu=PythonToVimStr(c.description),
|
||||||
info=PythonToVimStr(c.doc), # docstr
|
info=PythonToVimStr(c.doc), # docstr
|
||||||
|
|||||||
Reference in New Issue
Block a user