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
[CLOSED] Add "New Folder" and "Rename" features #1675
Comments
Comment by peterflynn Oh, one other comment actually -- the inline editor UI shows the filename in two places, so it needs to listen for the notification to. (Or maybe its TextRanges do, and then the inline editor UI listens to something they dispatch in turn). The Find in Files panel could be another one, but I think since we don't keep it up to date in other cases (e.g. the text content changing causing line numbers to shift) we could safely ignore it for now. |
Comment by gruehle For the inline editor, we actually get lucky. Only the filename is shown. If the file is renamed, it is selected before it is renamed, so the inline editor is closed. If a folder containing the file is renamed, no UI needs to change and the functionality works since the underlying document path is changed. Find in Files has been fixed. |
Comment by redmunds On Windows, when you use New Folder, the initial folder named "Untitled" is not sorted correctly. It's listed with the files (at the bottom) and not with the folders (at the top). Even after changing the name, it's still sorted with the files. |
Comment by redmunds Initial review complete |
Comment by gruehle Thanks for reviewing! All comments have been addressed and changes pushed. |
Comment by redmunds I notice another bug that the "New File" recognizes when a file named Untitled.js already exists, and then generates a unique name (e.g. Untitled-1.js), but "New Folder" does not generate a unique name. |
Comment by redmunds UTR BUG: I keep hitting the case where "New File" and "New Folder" stop working, but I can't nail down a reproducible recipe. Anyway, something to be on the lookout for. |
Comment by gruehle I fixed the "New Folder" untitled naming problem. I haven't seen cases where "New File" or "New Folder" break. Are you seeing this on Mac or PC? |
Comment by njx I've seen the failing "New File" in master, so it's not related to Glenn's changes. There seems to be some case where it throws an exception when trying to scroll the new file into view in the project panel. I'll try to find repro steps and file a bug. |
Comment by gruehle The selection is now done after sorting. Hopefully this resolves the last issue. |
Comment by redmunds Yes, this fixes the selection issue. This pull request is now ready to merge as soon as the necessary brackets-shell pull request gets merged. |
Comment by jasonsanjose Merging |
Issue by gruehle
Wednesday Sep 26, 2012 at 14:55 GMT
Originally opened as adobe/brackets#1719
This pull request adds two new features: New Folder, and Rename file/folder.
IMPORTANT: This pull request requires adobe/brackets-shell#120
USAGE
The New Folder command is added to the File menu and the project context menu. When selected, a new folder is created at the same level as the current selection in the project tree. If nothing in the project tree is selected (for example, if a file in the working set is selected), the folder is created at the root of the project folder.
The Rename command is added to the project context menu. It will rename the selected file or folder. Note that the Rename command will only work on project tree items. You cannot rename a file in the working set.
API NOTES
DocumentManager
dispatches a newfileNameChange
event whenever the name of a file or folder has changed.DirectoryEntry.getDirectory()
is now implemented. This will return a reference to an existing directory or create a new directory if needed.UNIT TESTS
Unit tests are added for rename(), but not directory creation. We need an API to remove a directory before we can add unit tests that create a directory.
gruehle included the following code: https://github.com/adobe/brackets/pull/1719/commits
The text was updated successfully, but these errors were encountered: