mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 02:46:43 +00:00
Add Diagnostics key context (#23043)
Closes #17337 Release Notes: - Add `Diagnostics` key context - Enables users to specify key bindings for that pane ```json { "context": "Diagnostics", "bindings": { "alt-q": "diagnostics::ToggleWarnings" } } ```
This commit is contained in:
parent
955248fee0
commit
1c6dd03e50
1 changed files with 2 additions and 3 deletions
|
@ -95,6 +95,7 @@ impl Render for ProjectDiagnosticsEditor {
|
||||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||||
let child = if self.path_states.is_empty() {
|
let child = if self.path_states.is_empty() {
|
||||||
div()
|
div()
|
||||||
|
.key_context("EmptyPane")
|
||||||
.bg(cx.theme().colors().editor_background)
|
.bg(cx.theme().colors().editor_background)
|
||||||
.flex()
|
.flex()
|
||||||
.items_center()
|
.items_center()
|
||||||
|
@ -106,10 +107,8 @@ impl Render for ProjectDiagnosticsEditor {
|
||||||
};
|
};
|
||||||
|
|
||||||
div()
|
div()
|
||||||
|
.key_context("Diagnostics")
|
||||||
.track_focus(&self.focus_handle(cx))
|
.track_focus(&self.focus_handle(cx))
|
||||||
.when(self.path_states.is_empty(), |el| {
|
|
||||||
el.key_context("EmptyPane")
|
|
||||||
})
|
|
||||||
.size_full()
|
.size_full()
|
||||||
.on_action(cx.listener(Self::toggle_warnings))
|
.on_action(cx.listener(Self::toggle_warnings))
|
||||||
.child(child)
|
.child(child)
|
||||||
|
|
Loading…
Reference in a new issue