diff --git a/Cargo.toml b/Cargo.toml index 34c84bb..e2bc8c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rowan" -version = "0.16.0" +version = "0.16.1" authors = ["Aleksey Kladov "] repository = "https://github.com/rust-analyzer/rowan" license = "MIT OR Apache-2.0" diff --git a/src/cursor.rs b/src/cursor.rs index 6b220af..cb6ceeb 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -408,7 +408,7 @@ impl NodeData { let rev_siblings = self.green_siblings().enumerate().rev(); let index = rev_siblings.len().checked_sub(self.index() as usize)?; - rev_siblings.skip(index + 1).find_map(|(index, child)| { + rev_siblings.skip(index).find_map(|(index, child)| { child.as_ref().into_node().and_then(|green| { let parent = self.parent_node()?; let offset = parent.offset() + child.rel_offset();