diff --git a/jedi/parser/fast.py b/jedi/parser/fast.py index d0cbcc89..4363cc05 100644 --- a/jedi/parser/fast.py +++ b/jedi/parser/fast.py @@ -353,6 +353,9 @@ class FastParser(use_metaclass(CachedFastParser)): - l.count(')') - l.count(']') - l.count('}'))) current_lines.append(l) + + if previous_line is not None: + current_lines.append(previous_line) if current_lines: yield gen_part() diff --git a/test/test_parser/test_fast_parser.py b/test/test_parser/test_fast_parser.py index aa7a3c34..d9b202af 100644 --- a/test/test_parser/test_fast_parser.py +++ b/test/test_parser/test_fast_parser.py @@ -75,6 +75,9 @@ def test_split_parts(): test('a\n\n', 'def b(): pass\n', 'c\n') test('a\n', 'def b():\n pass\n', 'c\n') + test('from x\\\n') + test('a\n\\\n') + def check_fp(src, number_parsers_used, number_of_splits=None, number_of_misses=0): if number_of_splits is None: