mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
Python: Improved the Add Virtual Environment path browser to start at the workspace root (#47988)
Previously, the 'Add Virtual Environment' path browser started at the filesystem root (`/`). Since virtual environments are almost always located within the project directory, starting at the worktree root provides feels a bit nicer to me. Release Notes: - Python: Improved the `Add Virtual Environment` path browser to start at the workspace root.
This commit is contained in:
parent
0ede074c05
commit
9aa71ddbce
1 changed files with 8 additions and 1 deletions
|
|
@ -110,7 +110,14 @@ impl AddToolchainState {
|
|||
.context("Could not find worktree")?;
|
||||
Ok(cx.new(|cx| {
|
||||
let (lister, rx) = Self::create_path_browser_delegate(project.clone(), cx);
|
||||
let picker = cx.new(|cx| Picker::uniform_list(lister, window, cx));
|
||||
let path_style = project.read(cx).path_style(cx);
|
||||
let picker = cx.new(|cx| {
|
||||
let picker = Picker::uniform_list(lister, window, cx);
|
||||
let mut worktree_root = worktree_root_path.to_string_lossy().into_owned();
|
||||
worktree_root.push_str(path_style.primary_separator());
|
||||
picker.set_query(&worktree_root, window, cx);
|
||||
picker
|
||||
});
|
||||
|
||||
Self {
|
||||
state: AddState::Path {
|
||||
|
|
|
|||
Loading…
Reference in a new issue