documents: lists go on inside quotes and after tabs; a waiting match lapses with its text and yields to a newer one
CI / platforms (windows-latest) (push) Failing after 8s
CI / site (push) Successful in 21s
CI / crate (push) Failing after 11m32s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

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-12 07:02:59 -04:00
1 parent edc328aadf
commit e162082f6f
4 files changed
+162 -91

No files matched your search

+8 -9
View File
@@ -15,6 +15,8 @@ impl MarkdownDocument {
.matches('\n')
.count()
};
// A newer request takes the place of one waiting.
self.showing = None;
match self.mode {
MarkdownMode::Source | MarkdownMode::Split => {
self.editor
@@ -26,8 +28,9 @@ impl MarkdownDocument {
self.reparse(true, cx);
}
if !self.read_now(cx) {
// A long text: shown once read.
self.showing = Some(range);
// Shown once read, if nothing else changed it.
let expected = self.edits + self.writes as u64;
self.showing = Some((range, expected));
return cx.notify();
}
let ix = self.block_at(range.start);
@@ -55,13 +58,9 @@ impl MarkdownDocument {
if self.showing.is_none() || !self.read_now(cx) {
return;
}
let range = self.showing.take().expect("checked above");
let text = self.editor.read(cx).text();
let fits = range.end <= text.len()
&& text.is_char_boundary(range.start)
&& text.is_char_boundary(range.end);
if !fits {
return log::warn!("markdown document: a waiting match outlived its text");
let (range, expected) = self.showing.take().expect("checked above");
if self.edits != expected {
return log::info!("markdown document: a waiting match lapsed with its text");
}
self.show_match(range, window, cx);
}