Make sure to only copy nodes that have the same indentation in diff parser

This commit is contained in:
Dave Halter committed 2020-04-04 16:07:54 +02:00
1 parent 3242e36859
commit f8dce76ef7
2 files changed
+28 -2

No files matched your search

+2 -1
View File
@@ -636,8 +636,9 @@ class _NodesTree(object):
# lines above there was an invalid indent.
indentation = _get_indentation(tree_nodes[0])
for i, c in enumerate(tree_nodes):
if c.start_pos[1] < indentation:
if c.start_pos[1] != indentation:
tree_nodes = tree_nodes[:i]
break
old_working_stack = list(self._working_stack)
old_prefix = self.prefix