task: Add re-run task button to terminal title (#12379)
Release Notes: - Added re-run task button to terminal title. Close #12277 ## Demo https://github.com/zed-industries/zed/assets/5518/4cd05fa5-4255-412b-8583-68e22f86561e --------- Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
This commit is contained in:
parent
36d0b71f27
commit
3c6c850390
7 changed files with 77 additions and 16 deletions
|
@ -9,7 +9,7 @@ use workspace::{tasks::schedule_resolved_task, Workspace};
|
|||
mod modal;
|
||||
mod settings;
|
||||
|
||||
pub use modal::Spawn;
|
||||
pub use modal::{Rerun, Spawn};
|
||||
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
settings::TaskSettings::register(cx);
|
||||
|
@ -20,7 +20,10 @@ pub fn init(cx: &mut AppContext) {
|
|||
.register_action(move |workspace, action: &modal::Rerun, cx| {
|
||||
if let Some((task_source_kind, mut last_scheduled_task)) =
|
||||
workspace.project().update(cx, |project, cx| {
|
||||
project.task_inventory().read(cx).last_scheduled_task()
|
||||
project
|
||||
.task_inventory()
|
||||
.read(cx)
|
||||
.last_scheduled_task(action.task_id.as_ref())
|
||||
})
|
||||
{
|
||||
if action.reevaluate_context {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue