Advance replay checkpoints through completed entry lines

This commit is contained in:
gloamxun committed 2026-11-29 11:10:17 +08:00
1 parent d249ec7eba
commit 51db480b34
5 files changed
+175 -14

No files matched your search

@@ -316,6 +316,17 @@ impl Mouth {
(matches!(self.line_breaks, LineBreaks::Physical) && !self.end_after_line && self.offset > 0)
.then_some(self.offset)
}
pub(super) fn line_consumed(&self) -> bool {
self.cursor >= self.line.len()
}
pub(super) fn same_loaded_prefix_constraint(&self, other: &Self) -> bool {
self.offset == other.offset
&& self.data[..self.offset] == other.data[..other.offset]
&& self.xe.as_ref().map(|xe| (xe.terminated, &xe.autodetected))
== other.xe.as_ref().map(|xe| (xe.terminated, &xe.autodetected))
}
pub(super) fn matches_loaded_prefix(&self, data: &[u8]) -> bool {
let Some(offset) = self.physical_frontier() else {
return false;