Remove another needless log buffer

This commit is contained in:
Kirill Bulatov 2023-10-17 20:53:39 +03:00
parent ba5c188630
commit c872c86c4a

View file

@ -376,7 +376,6 @@ impl LspLogView {
.projects .projects
.get(&project.downgrade()) .get(&project.downgrade())
.and_then(|project| project.servers.keys().copied().next()); .and_then(|project| project.servers.keys().copied().next());
let buffer = cx.add_model(|cx| Buffer::new(0, cx.model_id() as u64, ""));
let model_changes_subscription = cx.observe(&log_store, |this, store, cx| { let model_changes_subscription = cx.observe(&log_store, |this, store, cx| {
(|| -> Option<()> { (|| -> Option<()> {
let project_state = store.read(cx).projects.get(&this.project.downgrade())?; let project_state = store.read(cx).projects.get(&this.project.downgrade())?;
@ -425,7 +424,14 @@ impl LspLogView {
} }
} }
}); });
let (editor, _editor_subscription) = Self::editor_for_buffer(project.clone(), buffer, cx); // TODO kb deduplicate
let editor = cx.add_view(|cx| {
let mut editor = Editor::multi_line(None, cx);
editor.set_read_only(true);
editor.move_to_end(&Default::default(), cx);
editor
});
let _editor_subscription = cx.subscribe(&editor, |_, _, event, cx| cx.emit(event.clone()));
let mut this = Self { let mut this = Self {
editor, editor,
_editor_subscription, _editor_subscription,