Skip to content

Commit

Permalink
Fix first selected path not being primary resource when dropping mult…
Browse files Browse the repository at this point in the history
…iple files into Recaf
  • Loading branch information
Col-E committed Nov 24, 2024
1 parent 4ab6015 commit 4e8f402
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public void onDragDrop(@Nonnull Region region, @Nonnull DragEvent event, @Nonnul

if (config.createOnDragDrop()) {
// Create new workspace from files
Path primary = files.get(0);
// - The last path is actually the first file selected by the user when multiple files are selected
Path primary = files.getLast();
List<Path> supporting = files.size() > 1 ? files.subList(1, files.size()) : Collections.emptyList();
pathLoadingManager.asyncNewWorkspace(primary, supporting, err -> {
logger.error("Failed to create new workspace from dropped files", err);
Expand Down

0 comments on commit 4e8f402

Please sign in to comment.