Blur focused view when project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
b21d91db22
commit
77e913b5a4
3 changed files with 37 additions and 20 deletions
|
@ -51,13 +51,15 @@ impl Presenter {
|
|||
}
|
||||
|
||||
pub fn dispatch_path(&self, app: &AppContext) -> Vec<usize> {
|
||||
let mut view_id = app.focused_view_id(self.window_id).unwrap();
|
||||
let mut path = vec![view_id];
|
||||
while let Some(parent_id) = self.parents.get(&view_id).copied() {
|
||||
path.push(parent_id);
|
||||
view_id = parent_id;
|
||||
let mut path = Vec::new();
|
||||
if let Some(mut view_id) = app.focused_view_id(self.window_id) {
|
||||
path.push(view_id);
|
||||
while let Some(parent_id) = self.parents.get(&view_id).copied() {
|
||||
path.push(parent_id);
|
||||
view_id = parent_id;
|
||||
}
|
||||
path.reverse();
|
||||
}
|
||||
path.reverse();
|
||||
path
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue