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

[CLOSED] New File and New Folder execute in project root if there's no selection #10864

Open
core-ai-bot opened this issue Aug 30, 2021 · 4 comments

Comments

@core-ai-bot
Copy link
Member

Issue by MarcelGerber
Sunday Sep 04, 2016 at 22:34 GMT
Originally opened as adobe/brackets#12752


Fixes #9341 and #11472.

@dangoor's comments in #9341 are interesting, but I think he over-thought this.

The solution is actually as simple as providing an additional param to ProjectManager.getSelectedItem(), which is only false for this one call to the function, so it's not an API change.


MarcelGerber included the following code: https://github.com/adobe/brackets/pull/12752/commits

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Wednesday Sep 28, 2016 at 18:22 GMT


I think the boolean argument in this case isn't nice. When reading ProjectManager.getSelectedItem(false) is not immediately clear what it is used for.
WDYT of creating a specific function instead? And do you think is worth adding a test?
(I didn't review the rest of the PR)

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Tuesday Jun 13, 2017 at 22:32 GMT


@ficristo Quite a long time here, but I've finally incorporated your feedback. Let's take another look!

@core-ai-bot
Copy link
Member Author

Comment by ficristo
Thursday Jun 15, 2017 at 18:59 GMT


It seems fine to me.
Just a note: personally I would expect that the new file / folder is always created where people right click.
So if they right click at the root of the project (or in the empty area of the sidebar) the new file / folder should be created at the root of the project despite any selection.

@core-ai-bot
Copy link
Member Author

Comment by MarcelGerber
Thursday Jun 15, 2017 at 23:18 GMT


Thinking about that, you are right, that's the way it makes the most sense.
I've changed it that way now.

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

No branches or pull requests

1 participant