fix conditional negation being lost on field rename

https://forums.ankiweb.net/t/anki-force-changes-all-to/1694
This commit is contained in:
Damien Elmes 2020-08-02 09:28:29 +10:00
parent 0787a5d1da
commit f1a30c243a

View File

@ -689,12 +689,12 @@ fn rename_and_remove_fields(
// remove the field, preserving children
Some(None) => out.extend(children),
// rename it
Some(Some(new_name)) => out.push(ParsedNode::Conditional {
Some(Some(new_name)) => out.push(ParsedNode::NegatedConditional {
key: new_name.into(),
children,
}),
// or leave it alone
None => out.push(ParsedNode::Conditional { key, children }),
None => out.push(ParsedNode::NegatedConditional { key, children }),
}
}
}