In diagnostics editor, attempt to open excerpts in a different pane

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-01-10 16:33:25 -08:00
parent 747d9e8784
commit a0a558318c
2 changed files with 13 additions and 1 deletions

View file

@ -192,7 +192,9 @@ impl ProjectDiagnosticsEditor {
workspace.update(cx, |workspace, cx| {
for (buffer, ranges) in new_selections_by_buffer {
let buffer = BufferItemHandle(buffer);
workspace.activate_pane_for_item(&buffer, cx);
if !workspace.activate_pane_for_item(&buffer, cx) {
workspace.activate_next_pane(cx);
}
let editor = workspace
.open_item(buffer, cx)
.to_any()
@ -561,6 +563,10 @@ impl workspace::ItemView for ProjectDiagnosticsEditor {
unreachable!()
}
fn should_activate_item_on_event(event: &Self::Event) -> bool {
Editor::should_activate_item_on_event(event)
}
fn should_update_tab_on_event(event: &Event) -> bool {
matches!(
event,