Merge pull request #2427 from storytold/fix/page-keeps-its-view

M8: going back to a page shows it where it was left, not fitted again
This commit is contained in:
BFlat authored and GitHub committed 2026-11-17 18:26:23 +07:00
commit da2792cb4a
6 files changed
+65 -9

No files matched your search

+2 -4
View File
@@ -53,9 +53,8 @@ pub fn specs() -> Vec<CommandSpec> {
return Ok(json!({"id": id, "divider": true}));
}
let ds = s.ds_mut()?;
ds.page = id;
ds.open_page(id);
ds.selection.clear();
ds.zoom_to_fit();
Ok(json!({"id": id}))
}),
spec!("page.select", "Go to page", "{id | index}", false, |s, p| {
@@ -74,10 +73,9 @@ pub fn specs() -> Vec<CommandSpec> {
return Err(bad("page.select", "a divider isn't a page to open"));
}
let ds = s.ds_mut()?;
ds.page = id;
ds.open_page(id);
ds.selection.clear();
ds.text_edit = None;
ds.zoom_to_fit();
ok()
}),
spec!("page.rename", "Rename page", "{id?, name} (an empty page named with a leading hyphen becomes a divider)", true, |s, p| {
+1 -2
View File
@@ -187,9 +187,8 @@ fn page_step(s: &mut Session, dir: i64) -> Result<Value> {
}
};
let ds = s.ds_mut()?;
ds.page = pg;
ds.open_page(pg);
ds.selection.clear();
ds.zoom_to_fit();
Ok(json!({"page": pg}))
}