brackets-archive / brackets-shell

CEF3-based application shell for Brackets.
http://brackets.io
MIT License
0 stars 0 forks source link

[CLOSED] Initial implementation of drag and drop to open files #119

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by gruehle Thursday Jan 24, 2013 at 18:58 GMT Originally opened as https://github.com/adobe/brackets-shell/pull/190


The pull request adds an initial implementation of file association and drag and drop to open files.

Implemented on the Mac:

These work whether or not Brackets is already running

Missing on Mac: drag and drop onto a Brackets window. Chromium is swallowing all drag events so they never make it to the native shell.

Implemented on Windows:

Missing on Windows: Right click and select Open With > Brackets.exe. This requires registry modifications that would be best to do from the installer.

NOTE: There will be a corresponding brackets pull request that is required to open files at launch time.


gruehle included the following code: https://github.com/adobe/brackets-shell/pull/190/commits

core-ai-bot commented 3 years ago

Comment by redmunds Friday Jan 25, 2013 at 21:48 GMT


This works great on Windows.

Currently, Brackets always opens to the last opened project. It would be nice if Brackets detected that the file you dropped on it is contained in one of the projects in your recent projects list and automatically switched to that project.

UPDATE: ... only if Brackets is starting up (not when it's already open).

core-ai-bot commented 3 years ago

Comment by redmunds Friday Jan 25, 2013 at 22:32 GMT


On Mac, when I right-click, in the Open With sub-menu, the entry I see is "Brackets.app ()". Seems like there should no be any parens if they're empty.

core-ai-bot commented 3 years ago

Comment by redmunds Friday Jan 25, 2013 at 22:35 GMT


On Mac, I've seen a few crashes with "Brackets quit unexpectedly" message, but I have not been able to find a reproducible pattern.

core-ai-bot commented 3 years ago

Comment by gruehle Friday Jan 25, 2013 at 22:44 GMT


Currently, Brackets always opens to the last opened project. It would be nice if Brackets detected that the file you dropped on it is contained in one of the projects in your recent projects list and automatically switched to that project.

I'm not sure I agree... many times I want to open a file from a different project without changing the current project. I plan on adding support for dropping folders, which will either switch to that folder or open a new Brackets window showing the dropped folder (haven't figured out which is better yet..).

core-ai-bot commented 3 years ago

Comment by gruehle Friday Jan 25, 2013 at 22:45 GMT


On Mac, when I right-click, in the Open With sub-menu, the entry I see is "Brackets.app ()". Seems like there should no be any parens if they're empty.

Do you know how to control that? I saw the parens at first too, but I no longer see them on my mac.

core-ai-bot commented 3 years ago

Comment by redmunds Friday Jan 25, 2013 at 22:48 GMT


It would be nice if Brackets detected that the file you dropped on it is contained in one of the projects in your recent projects list and automatically switched to that project.

Allow me to qualify that some more. I don't think Brackets should switch projects if it is already open. I would only want Brackets to switch projects in the case where it is starting up to display a particular file.

core-ai-bot commented 3 years ago

Comment by gruehle Friday Jan 25, 2013 at 22:50 GMT


Ah, okay. That makes sense--thanks for clarifying.

I'd rather leave that for a subsequent pull request if that's okay with you.

core-ai-bot commented 3 years ago

Comment by redmunds Friday Jan 25, 2013 at 22:56 GMT


Wow, this really sucks trying to have multiple conversations with no threading :)

The empty paren thing seems to happen when right-clicking on a file that has a default app defined which is something other than Brackets. When I right-click on a .html file I see entries for "Safari.app (default)" and "Brackets.app ()". When I right-click on a .css file I see entries for "Brackets.app (default)" and "Safari.app".

core-ai-bot commented 3 years ago

Comment by redmunds Friday Jan 25, 2013 at 23:09 GMT


Done with initial review.

core-ai-bot commented 3 years ago

Comment by gruehle Saturday Jan 26, 2013 at 01:06 GMT


The parens show up for some file types, but not for others. If I right-click a markdown file, Sublime is the default app, and Brackets shows up without "()". If I right-click a .css file, Brackets shows up with "()". I don't know why.

core-ai-bot commented 3 years ago

Comment by gruehle Saturday Jan 26, 2013 at 01:16 GMT


Changes pushed.

core-ai-bot commented 3 years ago

Comment by redmunds Monday Jan 28, 2013 at 21:29 GMT


Not sure how important this is, but if you don't have setup_for_hacking setup (which gets cleared every time I do a build on Mac), and you drop a file on icon, Brackets is opened, but the file is forgotten.

core-ai-bot commented 3 years ago

Comment by redmunds Monday Jan 28, 2013 at 21:53 GMT


Done with second review.

I sent a crash log with the first review, and saw another crash just now. Any ideas about that?

core-ai-bot commented 3 years ago

Comment by gruehle Tuesday Jan 29, 2013 at 00:42 GMT


I can consistently reproduce the mac crash now with the following steps:

  1. Launch Brackets
  2. In the Finder, drag a file to the Brackets icon
  3. Click the close button on the Brackets window (note: you must click the close button--pressing Cmd-Q works)

Unfortunately, I haven't been able to determine a fix yet, so this shouldn't be merged until I have time to fix the crash.

core-ai-bot commented 3 years ago

Comment by gruehle Thursday Feb 14, 2013 at 00:48 GMT


@redmunds - I finally fixed the crash on quit bug. This pull request is now ready for final review.

core-ai-bot commented 3 years ago

Comment by redmunds Friday Feb 15, 2013 at 17:19 GMT


I can no longer reproduce crash.

Last question I have is, what do you think about the "if you don't have setup_for_hacking setup (which gets cleared every time I do a build on Mac), and you drop a file on icon, Brackets is opened, but the file is forgotten" issue?

core-ai-bot commented 3 years ago

Comment by gruehle Friday Feb 15, 2013 at 19:27 GMT


what do you think about the "if you don't have setup_for_hacking setup (which gets cleared every time I do a build on Mac), and you drop a file on icon, Brackets is opened, but the file is forgotten" issue?

I'm not really worried about it. You can drop files onto a running instance of Brackets in that case, so it only affects a minor use case for a small number of users.

core-ai-bot commented 3 years ago

Comment by redmunds Friday Feb 15, 2013 at 19:41 GMT


Looks good. Merging.