From 72571db6eef7da252869c5062036129896b1689d Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 18 Dec 2012 16:14:21 +0100 Subject: [PATCH] encode output strings to latin-1, vim has problems with utf8. fixes #48 --- jedi | 2 +- plugin/jedi_vim.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jedi b/jedi index 2d75f50..df95416 160000 --- a/jedi +++ b/jedi @@ -1 +1 @@ -Subproject commit 2d75f509b71178e50e8825eb0d1200c2888c625e +Subproject commit df95416160e2baad69aefa6059778346c6f5cc12 diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index 1d76e32..fa35926 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -21,6 +21,11 @@ class PythonToVimStr(encoding): """ Vim has a different string implementation of single quotes """ __slots__ = [] + def __new__(cls, s): + # VIM doesn't like UTF-8 + s = s.decode('latin-1') + return super(PythonToVimStr, cls).__new__(cls, s) + def __repr__(self): # this is totally stupid and makes no sense but vim/python unicode # support is pretty bad. don't ask how I came up with this... It just