From 80378d857bab4d444b417d68e52bd13d24e1c23d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 9 Dec 2016 00:10:20 +0100 Subject: [PATCH] Use `re.escape` for the `g:jedi#call_signature_escape` setting (#646) Fixes https://github.com/davidhalter/jedi-vim/issues/641. --- jedi_vim.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jedi_vim.py b/jedi_vim.py index ca96127..f0393f2 100644 --- a/jedi_vim.py +++ b/jedi_vim.py @@ -335,7 +335,8 @@ def clear_call_signatures(): # 1. Search for a line with a call signature and save the appended # characters # 2. Actually replace the line and redo the status quo. - py_regex = r'%sjedi=([0-9]+), (.*?)%s.*?%sjedi%s'.replace('%s', e) + py_regex = r'%sjedi=([0-9]+), (.*?)%s.*?%sjedi%s'.replace( + '%s', re.escape(e)) for i, line in enumerate(vim.current.buffer): match = re.search(py_regex, line) if match is not None: