Skip to content
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

Drag And Drop API For Views #5491

Open
gladclef opened this issue Jul 5, 2022 · 0 comments
Open

Drag And Drop API For Views #5491

gladclef opened this issue Jul 5, 2022 · 0 comments

Comments

@gladclef
Copy link

gladclef commented Jul 5, 2022

Problem description

I would like to add custom logic in my plugins about what to do with files dropped into view. Examples of house this could be used include:

  • adding a relative path to an image file in your html text
  • creating a phantom inside the view with a hyperlink to a website

Preferred solution

Add drop hooks in the EventListener to allow plugins to define custom behavior when a file is dragged in. Maybe something like on_drop(view: View)

Alternatives

There are ways to work around this, such as a context menu "import" option, but drag and drop is a fully new capability in the api as far as I can tell.

Additional Information

I originally posted this in the forums over at https://forum.sublimetext.com/t/drag-and-drop-hooks-in-api/64479.

I did a quick search through the api, the forums, and the github issues but didn't find anything related to drag and drop and the api, except for in regards to the file tree sidebar #16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants