Introduce a new WindowContext::remove_window
API
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f12746c4b7
commit
8c7f821d14
8 changed files with 25 additions and 29 deletions
|
@ -868,7 +868,9 @@ impl AppContext {
|
|||
let mut window = app_context.windows.remove(&window_id)?;
|
||||
let mut window_context = WindowContext::mutable(app_context, &mut window, window_id);
|
||||
let result = callback(&mut window_context);
|
||||
app_context.windows.insert(window_id, window);
|
||||
if !window_context.removed {
|
||||
app_context.windows.insert(window_id, window);
|
||||
}
|
||||
Some(result)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue