mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
repl: Pluck project off of editor directly (#48762)
The new multi workspace introduced in #47795 changed the window root from `Workspace` to `MultiWorkspace`, which broke `Workspace::for_window()` (assuming that was meant to). That returns `None` now. The REPL action registration in `repl_sessions_ui.rs` used this to check if the project was local, so when it got None, it silently skipped registering `repl::Run` and `repl::RunInPlace` on every editor. Luckily we can just get the project directly from the editor in order to register actions. Release Notes: - N/A
This commit is contained in:
parent
5e0d3123e9
commit
db6c006f73
1 changed files with 2 additions and 3 deletions
|
|
@ -78,9 +78,8 @@ pub fn init(cx: &mut App) {
|
|||
return;
|
||||
}
|
||||
|
||||
cx.defer_in(window, |editor, window, cx| {
|
||||
let workspace = Workspace::for_window(window, cx);
|
||||
let project = workspace.map(|workspace| workspace.read(cx).project().clone());
|
||||
cx.defer_in(window, |editor, _window, cx| {
|
||||
let project = editor.project().cloned();
|
||||
|
||||
let is_local_project = project
|
||||
.as_ref()
|
||||
|
|
|
|||
Loading…
Reference in a new issue