Compare the objects in heading titles when diffing the asts.
This commit is contained in:
parent
c2bf2c6994
commit
37b91d171d
@ -243,6 +243,22 @@ fn compare_heading<'s>(
|
|||||||
this_status = DiffStatus::Bad;
|
this_status = DiffStatus::Bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let title = {
|
||||||
|
let children = emacs.as_list()?;
|
||||||
|
let attributes_child = children
|
||||||
|
.iter()
|
||||||
|
.nth(1)
|
||||||
|
.ok_or("Should have an attributes child.")?;
|
||||||
|
let attributes_map = attributes_child.as_map()?;
|
||||||
|
let title = attributes_map
|
||||||
|
.get(":title")
|
||||||
|
.ok_or("Missing :title attribute.");
|
||||||
|
*title?
|
||||||
|
};
|
||||||
|
for (emacs_child, rust_child) in title.as_list()?.iter().zip(rust.title.iter()) {
|
||||||
|
child_status.push(compare_object(source, emacs_child, rust_child)?);
|
||||||
|
}
|
||||||
|
|
||||||
for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) {
|
for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) {
|
||||||
match rust_child {
|
match rust_child {
|
||||||
DocumentElement::Heading(rust_heading) => {
|
DocumentElement::Heading(rust_heading) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user