T21a round 1 fixes

- Enter over a selection drops it and splits at its start, one undo step
- undo and redo keep where the caret was and put it back
- a format unwraps only its own markers, so italic inside bold keeps the bold
- keys into a merged table cell land on the cell that shows
- undo rebuilds a block whose kind needs other fields, so styling comes back
- tests activate their window, as focus events need
- undo bookkeeping moves to blocks/edit.rs
This commit is contained in:
ZacharyZhang-NY committed 2026-09-26 03:49:27 -04:00
1 parent 6a9ce8a2c3
commit f3e2c6c27f
10 files changed
+330 -81

No files matched your search

+9
View File
@@ -25,6 +25,15 @@ pub(crate) fn span(merged: &[(usize, usize)], columns: usize, row: usize, column
.count()
}
/// The cell that shows for `cell`: itself, or the one a merge folds it into.
pub(crate) fn shown_cell(merged: &[(usize, usize)], columns: usize, cell: usize) -> usize {
let (row, mut column) = (cell / columns, cell % columns);
while column > 0 && merged.contains(&(row, column)) {
column -= 1;
}
row * columns + column
}
/// Merges after `column` is removed: its own go, the ones right of it move left.
pub(crate) fn without_column(merged: &[(usize, usize)], column: usize) -> Vec<(usize, usize)> {
merged