Select right-clicked entry before deploying context menu
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
3b2f1644fb
commit
85ed7b41f1
1 changed files with 10 additions and 0 deletions
|
@ -207,6 +207,15 @@ impl ProjectPanel {
|
|||
}
|
||||
|
||||
fn deploy_context_menu(&mut self, action: &DeployContextMenu, cx: &mut ViewContext<Self>) {
|
||||
if let Some(entry_id) = action.entry_id {
|
||||
if let Some(worktree_id) = self.project.read(cx).worktree_id_for_entry(entry_id, cx) {
|
||||
self.selection = Some(Selection {
|
||||
worktree_id,
|
||||
entry_id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
self.context_menu.update(cx, |menu, cx| {
|
||||
menu.show(
|
||||
action.position,
|
||||
|
@ -232,6 +241,7 @@ impl ProjectPanel {
|
|||
cx,
|
||||
);
|
||||
});
|
||||
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue