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] Ensure that the baseDir for createNewItem is within the project. #8940

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

Comments

@core-ai-bot
Copy link
Member

Issue by dangoor
Wednesday Dec 03, 2014 at 14:24 GMT
Originally opened as adobe/brackets#10072


This is a fix for #9910.


dangoor included the following code: https://github.com/adobe/brackets/pull/10072/commits

@core-ai-bot
Copy link
Member Author

Comment by busykai
Wednesday Dec 03, 2014 at 23:32 GMT


@dangoor, while reviewing and testing this. I'm curious, which code was triggering the project tree redraw?

@core-ai-bot
Copy link
Member Author

Comment by le717
Wednesday Dec 03, 2014 at 23:48 GMT


Hehe, I needed this functionality (getDirectoryInProject()) in my extension a few months ago. I would pull in a path in my project but it would sometimes pull a fuller, incorrect path.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Thursday Dec 04, 2014 at 19:53 GMT


LGTM. Merging.

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Thursday Dec 04, 2014 at 19:59 GMT


@busykai the project tree redraws any time the view model changes.

@core-ai-bot
Copy link
Member Author

Comment by busykai
Thursday Dec 04, 2014 at 20:22 GMT


@dangoor, I was trying to understand why the project root in the model would shift, hence the question. thanks!

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Friday Dec 05, 2014 at 15:58 GMT


@busykai I didn't dive into that, but my guess is that the absolute path was sent all the way through, so the FileTreeViewModel then had to account for all of those extra directories. You do raise a good question, though: it would likely be better for that absolute path to be rejected at that point that it was introduced. The fix in this pull request is still the right fix for this particular problem, because when you create a file or directory by clicking in the blank space it should create the new item in the project rather than rejecting.

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