Fix BlockMap's handling of trailing empty excerpt updates with other edits

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-02-09 11:54:59 -08:00
parent cbf59ffafb
commit fc70c6d4fd
4 changed files with 67 additions and 64 deletions

View file

@ -106,7 +106,7 @@ impl WrapMap {
tab_snapshot: TabSnapshot,
edits: Vec<TabEdit>,
cx: &mut ModelContext<Self>,
) -> (WrapSnapshot, Vec<WrapEdit>) {
) -> (WrapSnapshot, Patch<u32>) {
if self.wrap_width.is_some() {
self.pending_edits.push_back((tab_snapshot, edits));
self.flush_edits(cx);
@ -117,10 +117,7 @@ impl WrapMap {
self.snapshot.interpolated = false;
}
(
self.snapshot.clone(),
mem::take(&mut self.edits_since_sync).into_inner(),
)
(self.snapshot.clone(), mem::take(&mut self.edits_since_sync))
}
pub fn set_font(&mut self, font_id: FontId, font_size: f32, cx: &mut ModelContext<Self>) {