From be595d326d8e1746b54318383080674c7ed21c8f Mon Sep 17 00:00:00 2001 From: David Halter Date: Sun, 14 Oct 2012 02:44:12 +0200 Subject: [PATCH] fixed another string literal problem with func defs --- plugin/jedi_vim.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/jedi_vim.py b/plugin/jedi_vim.py index 029af88..e3c1570 100644 --- a/plugin/jedi_vim.py +++ b/plugin/jedi_vim.py @@ -199,10 +199,11 @@ def show_func_def(call_def, completion_lines=0): # Check the replace stuff for strings, to append them # (don't want to break the syntax) - regex_quotes = '\\\\*["\']+' + regex_quotes = r'''\\*["']+''' # `add` are all the quotation marks. add = ''.join(re.findall(regex_quotes, replace)) - if add: + # search backwards + if add and replace[0] in ['"', "'"]: a = re.search(regex_quotes + '$', prefix) add = ('' if a is None else a.group(0)) + add