1
0
forked from VimPlug/jedi

use the new implementation of splitlines all over the code, fixes #424

This commit is contained in:
Dave Halter
2014-07-18 16:59:22 +02:00
parent ffaacbefbc
commit ee1c5041ed
4 changed files with 8 additions and 14 deletions

View File

@@ -2,6 +2,7 @@ import re
import os
from jedi import cache
from jedi import common
from jedi.parser import tokenize
from jedi._compatibility import u
from jedi.parser.fast import FastParser
@@ -178,12 +179,7 @@ class UserContext(object):
def get_line(self, line_nr):
if not self._line_cache:
self._line_cache = self.source.splitlines()
if self.source:
if self.source[-1] == '\n':
self._line_cache.append(u(''))
else: # ''.splitlines() == []
self._line_cache = [u('')]
self._line_cache = common.splitlines(self.source)
if line_nr == 0:
# This is a fix for the zeroth line. We need a newline there, for