Fix diff parser: Skip last leaves for last line offset leaves

This commit is contained in:
Dave Halter
2019-01-17 00:15:01 +01:00
parent dac4c445a7
commit e591b929eb
2 changed files with 15 additions and 0 deletions

View File

@@ -466,6 +466,10 @@ class _NodesTreeNode(object):
if self._children_groups:
children_group = self._children_groups[-1]
last_leaf = children_group.last_line_offset_leaf
while last_leaf.type == 'error_leaf' \
and last_leaf.token_type in _INDENTATION_TOKENS:
last_leaf = last_leaf.get_previous_leaf()
line = last_leaf.end_pos[0] + children_group.line_offset
# Newlines end on the next line, which means that they would cover