Start rendering highlighted text and line numbers via the wrap map

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-07-20 18:03:02 -07:00
co-authored by Nathan Sobo
parent b513df3844
commit 72fdd3fb9a
6 changed files with 161 additions and 26 deletions
+9 -1
View File
@@ -21,7 +21,7 @@ use gpui::{
WeakViewHandle,
};
use parking_lot::Mutex;
use postage::watch;
use postage::{prelude::Stream, watch};
use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use smol::Timer;
@@ -413,6 +413,14 @@ impl Editor {
let display_map =
DisplayMap::new(buffer.clone(), settings.borrow().clone(), None, cx.as_ref());
let mut notifications = display_map.notifications();
cx.spawn(|this, mut cx| async move {
while notifications.recv().await.is_some() {
this.update(&mut cx, |_, cx| cx.notify());
}
})
.detach();
let mut next_selection_id = 0;
let selection_set_id = buffer.update(cx, |buffer, cx| {
buffer.add_selection_set(