From d6bc05cad05c9104ff56d498e25f112d00e7fc71 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 13 Nov 2021 18:19:21 -0700 Subject: [PATCH] Fix BlockMap unit test by skipping below blocks when advancing transforms --- crates/editor/src/display_map/block_map.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/editor/src/display_map/block_map.rs b/crates/editor/src/display_map/block_map.rs index 0862e06ce4..e84f3fe41d 100644 --- a/crates/editor/src/display_map/block_map.rs +++ b/crates/editor/src/display_map/block_map.rs @@ -161,6 +161,13 @@ impl BlockMap { if edit.old.end > cursor.start().0 { cursor.seek(&InputRow(edit.old.end), Bias::Left, &()); cursor.next(&()); + while let Some(item) = cursor.item() { + if item.is_isomorphic() { + break; + } else { + cursor.next(&()); + } + } let transform_end = cursor.start().0; edit.new.end += transform_end - edit.old.end; edit.old.end = transform_end;