forked from VimPlug/jedi
new splitlines implementation to get rid of the ugly splitlines we now have as well as (partially) the issue with form feeds
This commit is contained in:
@@ -86,9 +86,7 @@ class Script(object):
|
||||
with open(path) as f:
|
||||
source = f.read()
|
||||
|
||||
lines = source.splitlines() or ['']
|
||||
if source and source[-1] == '\n':
|
||||
lines.append('')
|
||||
lines = common.splitlines(source)
|
||||
line = max(len(lines), 1) if line is None else line
|
||||
if not (0 < line <= len(lines)):
|
||||
raise ValueError('`line` parameter is not in a valid range.')
|
||||
|
||||
Reference in New Issue
Block a user