Merge pull request #1255 from zed-industries/terminal-fr

WIP: Terminal
This commit is contained in:
Mikayla Maki 2022-06-30 11:30:28 -07:00 committed by GitHub
commit 2ee57c1512
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1250 additions and 8 deletions

View file

@ -703,6 +703,20 @@ impl<'a> EventContext<'a> {
self.view_stack.last().copied()
}
pub fn is_parent_view_focused(&self) -> bool {
if let Some(parent_view_id) = self.view_stack.last() {
self.app.focused_view_id(self.window_id) == Some(*parent_view_id)
} else {
false
}
}
pub fn focus_parent_view(&mut self) {
if let Some(parent_view_id) = self.view_stack.last() {
self.app.focus(self.window_id, Some(*parent_view_id))
}
}
pub fn dispatch_any_action(&mut self, action: Box<dyn Action>) {
self.dispatched_actions.push(DispatchDirective {
dispatcher_view_id: self.view_stack.last().copied(),