Fix diff parser: Avoid indentation issues

This commit is contained in:
Dave Halter
2019-01-05 22:40:31 +01:00
parent d1d866f6c6
commit 428bde0573
2 changed files with 48 additions and 0 deletions

View File

@@ -564,6 +564,10 @@ class _NodesTree(object):
Returns the number of tree nodes that were copied.
"""
if tree_nodes[0].type == 'error_leaf' and tree_nodes[0].token_type == 'INDENT':
# Avoid copying error indents. Just parse them again.
return []
self._get_insertion_node(tree_nodes[0])
new_nodes, self._working_stack = self._copy_nodes(