-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
Adds all the files that were selected to the working set Opens the last file in the editor
} | ||
}); | ||
} else { | ||
result = doOpen(fullPath); | ||
} | ||
if (!result) { | ||
result = (new $.Deferred()).reject().promise(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this old code handles the case where the user canceled the dialog. I think with your changes, the method would return a Deferred that never finishes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I fixed this now
if (!result) { | ||
result = (new $.Deferred()).reject().promise(); | ||
} | ||
|
||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you're creating a wrapper Deferred above, this should change to return result.promise()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, done
Code looks good. This even works on Mac with no changes to native shell. |
I think we're good to merge once that TODO has been removed (and cleaning up the then() if it's not too much trouble). |
I removed the TODO comment and clean up the .then now. |
Looks great! We can merge this as soon as adobe/brackets-app#121 lands. |
I spotted a bug while playing with this, but it requires a bit of thinking about where the fix should go... so rather than hold this up even longer, I'm going to merge it now and file a bug assigned to @conradz for the remaining piece. |
Enable multi-select in File Open dialog
Ok, so after doing a bit more investigation I've decided not to file a bug. The behavior that seemed wrong is the order multi-selected files are opened in: if I shift+select a range of files named A,B,C,D,E the order they are opened in Brackets is E,A,B,C,D with D as the current file (the second to last file in the range I selected). Bizarre as this order seems to be, though, every other Windows app I've tried behaves the same way. It doesn't seem compelling enough to do extra work to deviate from that "standard." |
During my testing, I did run into that strange behavior. It seems that windows doesn't really care about the order that files are selected, although I never did nail down the exact pattern that you found. I tried to make it select the last file in the array of paths that |
On a Mac it always seems to order the files in the dialog's list view sort order (so, typically alphabetically). Mac apps seem to always select the last one in the list, so I think we're good there. On Win I can't quite figure out the rules. For a simple shift+select it consistently uses the list view sort order except that the last item clicked is moved to the front of the list -- which is usually completely out of order. But for ctrl+select I can't make sense of what Windows does. Sometimes it seems to list files in the order they were selected (except for the last-clicked item of course), but other times it ignores the click order and always lists files in sort order, like the Mac (except, again, for the last-clicked item). Go figure... |
We could sort by name on Windows after the list is returned, although I don't know if it's really that important. It might be nicer to let the user drag the files that are opened to order them in the order that they want them. |
@peterflynn I might look into allowing the user to drag the files in the working set. Do you know if there is a chance we could add other libraries, such as the drag functionality in jquery-ui for this? |
I don't think we have to worry about fixing up the order on Windows, since Brackets' current behavior (using the order the dialog gives us, however weird it may be) is consistent with all other Win apps I tried. Re dragging in the working set -- sounds like a good topic to start a discussion on the forum: http://groups.google.com/group/brackets-dev |
…a WebRTC. (adobe#855) * Initialized file transfer protocol * Experimenting with sending files * Added logic to send and interpret file events * Shifted to file object to blob * Fixed inundation * Added error handling, cleared _received array * Fixed code inundation * Shifted to files from blobs * Implemented review comments * Fixes typo * Shifted from timeout to trigger
(Continues pull request #823)
This adds support for opening multiple files, by adding all the files that were selected to the working set and then opening the last file in the editor.