Refactoring about checking \r\n (#1603)

This commit is contained in:
yuan
2020-05-31 17:13:30 +08:00
committed by GitHub
parent 98a8b6c76c
commit 5946a5cd8c

View File

@@ -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