project: Check path extension first, then worktree's (#29671)
This fixes a bug with opening images on worktrees that contain "extension" in the dir name, like `zed.dev` Release Notes: - N/A
This commit is contained in:
parent
5589e78a69
commit
632f08d2a3
1 changed files with 2 additions and 2 deletions
|
@ -217,9 +217,9 @@ pub fn is_image_file(project: &Entity<Project>, path: &ProjectPath, cx: &App) ->
|
||||||
.worktree_for_id(path.worktree_id, cx)?
|
.worktree_for_id(path.worktree_id, cx)?
|
||||||
.read(cx)
|
.read(cx)
|
||||||
.abs_path();
|
.abs_path();
|
||||||
worktree_abs_path
|
path.path
|
||||||
.extension()
|
.extension()
|
||||||
.or_else(|| path.path.extension())
|
.or_else(|| worktree_abs_path.extension())
|
||||||
.and_then(OsStr::to_str)
|
.and_then(OsStr::to_str)
|
||||||
.map(str::to_lowercase)
|
.map(str::to_lowercase)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue