mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Refactoring about checking \r\n (#1603)
This commit is contained in:
@@ -470,8 +470,8 @@ def validate_line_column(func):
|
|||||||
line_string = self._code_lines[line - 1]
|
line_string = self._code_lines[line - 1]
|
||||||
line_len = len(line_string)
|
line_len = len(line_string)
|
||||||
if line_string.endswith('\r\n'):
|
if line_string.endswith('\r\n'):
|
||||||
line_len -= 1
|
line_len -= 2
|
||||||
if line_string.endswith('\n'):
|
elif line_string.endswith('\n'):
|
||||||
line_len -= 1
|
line_len -= 1
|
||||||
|
|
||||||
column = line_len if column is None else column
|
column = line_len if column is None else column
|
||||||
|
|||||||
Reference in New Issue
Block a user