Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-core/src/syntax/tree_cursor.rs')
-rw-r--r--helix-core/src/syntax/tree_cursor.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-core/src/syntax/tree_cursor.rs b/helix-core/src/syntax/tree_cursor.rs
index 692d5890..bec4a1c6 100644
--- a/helix-core/src/syntax/tree_cursor.rs
+++ b/helix-core/src/syntax/tree_cursor.rs
@@ -204,7 +204,7 @@ impl<'a> TreeCursor<'a> {
self.injection_ranges[start_idx..]
.iter()
- .take_while(|range| range.start < end)
+ .take_while(|range| range.start < end || range.depth > 1)
.find_map(|range| (range.start <= start).then_some(range.layer_id))
.unwrap_or(self.root)
}