Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Merge PR #964

Brandon Thomasc5ea51ec4d20
diff --cc crates/engine/src/cmd/layout.rs
index 5514a18c4,79a555f3b..ea562cf49
--- a/crates/engine/src/cmd/layout.rs
+++ b/crates/engine/src/cmd/layout.rs
@@@ -476,13 -476,14 +476,16 @@@ pub fn specs() -> Vec<CommandSpec>
let start = page - 1;
let p = p.clone();
s.edit(|d, _| {
+ // The settings the command does not name stay as the section was: read it
+ // before the list is rebuilt (#717).
+ let existing = d.sections.iter().find(|x| x.start == start).cloned();
d.sections.retain(|x| x.start != start || start == 0);
if p.get("remove").and_then(Value::as_bool).unwrap_or(false) && start != 0 {
+ // The pages after it follow the previous section's numbers again.
+ d.repaginate();
return ok();
}
- let mut sec = d.sections.iter().find(|x| x.start == start).cloned().unwrap_or(designcraft_doc::Section {
+ let mut sec = existing.unwrap_or(designcraft_doc::Section {
start,
start_number: None,
style: Default::default(),