From 9cdf6de206f432bb84a43696b57c39af957d5668 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 17 Dec 2014 17:51:12 +0100 Subject: [PATCH] More positioning for backwards tokenizer. --- jedi/parser/user_context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jedi/parser/user_context.py b/jedi/parser/user_context.py index 70636e3b..b34d82a9 100644 --- a/jedi/parser/user_context.py +++ b/jedi/parser/user_context.py @@ -55,7 +55,9 @@ class UserContext(object): column = start_pos[1] - tok_start_pos[1] else: column = len(line) - tok_start_pos[1] - column -= len(tok_str) + # Multi-line docstrings must be accounted for. + first_line = (tok_str.splitlines() or [''])[0] + column -= len(first_line) # Reverse the token again, so that it is in normal order again. yield typ, tok_str[::-1], (self._line_temp, column), prefix