Fix OpenPathPrompt locally with tilde (#17027)
Release Notes: - Fixed a panic opening a file in ~/ with `use_system_prompts: false`
This commit is contained in:
parent
9beb4d4380
commit
f19d0f0b98
2 changed files with 14 additions and 1 deletions
|
@ -664,6 +664,14 @@ impl DirectoryLister {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn resolve_tilde<'a>(&self, path: &'a String, cx: &AppContext) -> Cow<'a, str> {
|
||||
if self.is_local(cx) {
|
||||
shellexpand::tilde(path)
|
||||
} else {
|
||||
Cow::from(path)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn default_query(&self, cx: &mut AppContext) -> String {
|
||||
if let DirectoryLister::Project(project) = self {
|
||||
if let Some(worktree) = project.read(cx).visible_worktrees(cx).next() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue