From 5946a5cd8cd7bcf6807577cc3904810ee43095f0 Mon Sep 17 00:00:00 2001 From: yuan Date: Sun, 31 May 2020 17:13:30 +0800 Subject: [PATCH] Refactoring about checking \r\n (#1603) --- jedi/api/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index 91ec2806..011bdfcc 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -470,8 +470,8 @@ def validate_line_column(func): line_string = self._code_lines[line - 1] line_len = len(line_string) if line_string.endswith('\r\n'): - line_len -= 1 - if line_string.endswith('\n'): + line_len -= 2 + elif line_string.endswith('\n'): line_len -= 1 column = line_len if column is None else column