Restore the ability to drag and drop images into the editor (#31009)

`ImageItem`'s `file` is returning `""` as its `path` for single-filed
worktrees like the ones are created for the images dropped from the OS.
`ImageItem::load_image_metadata` had used that `path` in FS operations
and the other method tried to use for icon resolving.

Rework the code to use a more specific, `worktree::File` instead and
always use the `abs_path` when dealing with paths from this `file`.

Release Notes:

- Fixed images not opening on drag and drop into the editor
This commit is contained in:
Kirill Bulatov 2025-05-20 15:38:24 +03:00 committed by GitHub
parent 944a0df436
commit e4262f97af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 39 additions and 33 deletions

1
Cargo.lock generated
View file

@ -7946,6 +7946,7 @@ dependencies = [
"editor",
"file_icons",
"gpui",
"language",
"log",
"project",
"schemars",