Diagnostics pane was not focusable with the mouse (#2506)

fixes
https://linear.app/zed-industries/issue/Z-1432/cant-cmd-w-an-empty-diagnostics-in-a-split-pane

Release Notes:

* Fixed a bug where the diagnostics pane could not be focused or closed
in certain circumstances.
This commit is contained in:
Mikayla Maki 2023-05-22 12:44:39 -07:00 committed by GitHub
commit dcb987ba9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 10 deletions

View file

@ -7207,6 +7207,7 @@ pub enum Event {
BufferEdited,
Edited,
Reparsed,
Focused,
Blurred,
DirtyChanged,
Saved,
@ -7258,8 +7259,10 @@ impl View for Editor {
}
fn focus_in(&mut self, _: AnyViewHandle, cx: &mut ViewContext<Self>) {
dbg!("Editor Focus in");
if cx.is_self_focused() {
let focused_event = EditorFocused(cx.handle());
cx.emit(Event::Focused);
cx.emit_global(focused_event);
}
if let Some(rename) = self.pending_rename.as_ref() {