Minor improvements to dock visuals, rework dock keybindings, and fix panic on split when dock is active

This commit is contained in:
K Simmons 2022-09-16 12:55:36 -07:00
parent 29f46539f0
commit 1ce48f4a94
8 changed files with 165 additions and 110 deletions

View file

@ -755,35 +755,34 @@ impl Element for TerminalElement {
_paint: &mut Self::PaintState,
cx: &mut gpui::EventContext,
) -> bool {
match event {
Event::KeyDown(KeyDownEvent { keystroke, .. }) => {
if !cx.is_parent_view_focused() {
return false;
}
if let Some(view) = self.view.upgrade(cx.app) {
view.update(cx.app, |view, cx| {
view.clear_bel(cx);
view.pause_cursor_blinking(cx);
})
}
self.terminal
.upgrade(cx.app)
.map(|model_handle| {
model_handle.update(cx.app, |term, cx| {
term.try_keystroke(
keystroke,
cx.global::<Settings>()
.terminal_overrides
.option_as_meta
.unwrap_or(false),
)
})
})
.unwrap_or(false)
if let Event::KeyDown(KeyDownEvent { keystroke, .. }) = event {
if !cx.is_parent_view_focused() {
return false;
}
_ => false,
if let Some(view) = self.view.upgrade(cx.app) {
view.update(cx.app, |view, cx| {
view.clear_bel(cx);
view.pause_cursor_blinking(cx);
})
}
self.terminal
.upgrade(cx.app)
.map(|model_handle| {
model_handle.update(cx.app, |term, cx| {
term.try_keystroke(
keystroke,
cx.global::<Settings>()
.terminal_overrides
.option_as_meta
.unwrap_or(false),
)
})
})
.unwrap_or(false)
} else {
false
}
}