Skip to content

Drag and drop of a (source) file in IDE also adds its path to (content of the file in the) active tab #2723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
maarten-pennings opened this issue Apr 25, 2025 · 0 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@maarten-pennings
Copy link

Describe the problem

The IDE is open, showing one or more files in the code pane. Each file is in its own tab, one tab/file has focus. From the file explorer I drag and drop a file in the code pane.

Two actions happen:

  • A new tab is created, the dropped file is loaded into that tab, the tab is given focus. The tab is decorated by a lock. This is the wanted action.
  • The tab that was in focus just before the drop is "edited"; it gets characters added, namely the full path of the file dropped. This is unwanted behavior.

Why would you want to drop a file? For example to inspect the source code of a used library, maybe even to put a breakpoint there for a debug session.

To reproduce

Open any project. Here I opened a project where I just added one extra empty file file driver1.h for fun.

Screenshot before the drop.

Image

Screenhot while dragging. Do note the funny extra 5 dot cursor in column 0 of line 3.

Image

Screenshot after the drop, notice the dropped file driver2.h is added as tab and in focus.

Image

Situation after the drop in the "old file", notice line 3 has the path to driver2.h. That was where the funny 5 dot cursor was when dropping.

Image

Expected behavior

I expect the dropped file to be added (which happens).
I do not expect the current file to be edited.

Arduino IDE version

2.3.5

Operating system

Windows

Operating system version

Edition Windows 10 Enterprise, Version 22H2, OS build 19045.5737, Windows Feature Experience Pack 1000.19061.1000.0

Additional context

Observation: When dropping on the tab bar instead of the source pane, the wanted behavior takes place, and the unwanted is skipped. Acceptible work-around (once known), but harder to aim.

Same behavior in nightly build

Image

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@maarten-pennings maarten-pennings added the type: imperfection Perceived defect in any part of project label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant