Skip to content

Commit 67adf48

Browse files
committed
ZED_WORKTREE_ROOT now always points to a workspace root directory
1 parent c33eb01 commit 67adf48

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: crates/project/src/task_inventory.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -489,17 +489,17 @@ impl ContextProvider for BasicContextProvider {
489489
if !selected_text.trim().is_empty() {
490490
task_variables.insert(VariableName::SelectedText, selected_text);
491491
}
492-
let worktree_abs_path =
492+
let worktree_root_dir =
493493
buffer
494494
.file()
495495
.map(|file| file.worktree_id(cx))
496496
.and_then(|worktree_id| {
497497
self.worktree_store
498498
.read(cx)
499499
.worktree_for_id(worktree_id, cx)
500-
.map(|worktree| worktree.read(cx).abs_path())
500+
.map(|worktree| worktree.read(cx).root_dir())
501501
});
502-
if let Some(worktree_path) = worktree_abs_path {
502+
if let Some(Some(worktree_path)) = worktree_root_dir {
503503
task_variables.insert(
504504
VariableName::WorktreeRoot,
505505
worktree_path.to_string_lossy().to_string(),

0 commit comments

Comments
 (0)