documents: table moves and tidy read apart; a code press names its text

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-14 15:16:42 -04:00
1 parent 0558f0c890
commit bcee87c08f
12 files changed
+321 -106

No files matched your search

+16
View File
@@ -8,6 +8,7 @@ use super::{
DocumentEvent, LARGEST_READ, MarkdownDocument,
block::{self, BlockCommand},
format::{Change, EditRefusal, InlineFormat, toggle},
tables::{self, TableEdit},
};
use crate::documents::{MarkdownMode, modes::joint};
@@ -41,6 +42,21 @@ impl MarkdownDocument {
)
}
/// `edit` on the table at the caret, read apart.
pub fn edit_table(
&mut self,
edit: TableEdit,
cx: &mut Context<Self>,
) -> Result<(), EditRefusal> {
self.apart(
format!("table edit {edit:?}"),
move |full, selection| {
tables::edit_table(full, selection.start, edit).map_err(EditRefusal::Cells)
},
cx,
)
}
/// Reads `read` off the UI thread, then writes its change.
fn apart(
&mut self,