mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 02:20:10 +00:00
Re-focus diagnostics editor when transitioning from an empty to a populated state
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
1875a0e349
commit
571d0386e2
1 changed files with 8 additions and 2 deletions
|
@ -389,8 +389,14 @@ impl ProjectDiagnosticsEditor {
|
|||
self.path_states.remove(path_ix);
|
||||
}
|
||||
|
||||
if self.editor.is_focused(cx) && self.path_states.is_empty() {
|
||||
cx.focus_self();
|
||||
if self.path_states.is_empty() {
|
||||
if self.editor.is_focused(cx) {
|
||||
cx.focus_self();
|
||||
}
|
||||
} else {
|
||||
if cx.handle().is_focused(cx) {
|
||||
cx.focus(&self.editor);
|
||||
}
|
||||
}
|
||||
cx.notify();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue