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

for add-project-folder, use current path if non selected #149

Merged
merged 1 commit into from Oct 4, 2017

Conversation

toumorokoshi
Copy link
Contributor

Hi! I'm coming to atom from emacs, and advanced-open-file rocks.

I'd love to save the down keystroke when I'm adding a project folder. This patch would allow using the currentPath, if it's a folder.

@@ -592,7 +592,7 @@ describe('Functional tests', () => {

it('can open files in new split panes', () => {
atom.workspace.open(fixturePath('sample.js'));
expect(atom.workspace.getPanes().length).toEqual(1);
const initialPaneCount = atom.workspace.getPanes().length;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test was failing for me, and I found using a relative pane count fixed it.

Copy link
Owner

@Osmose Osmose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me, thanks for the patch!

There's one minor bug that I don't actually understand; it seems that if I try to use the "add current directory" function to add a directory that is already a project directory, it doesn't beep. Instead, if shows the success notification again, although it doesn't duplicate the directory or anything.

But, as far as I can tell, it's addProjectFolder that should be checking this, not your code. Any ideas as to why this is happening?

@toumorokoshi
Copy link
Contributor Author

It looks like the current atom does not beep if one attempts to re-add the directory: it just silently returns:

https://github.com/atom/atom/blob/v1.21.0/src/project.coffee#L233

If you'd like, I'm happy to add a beep, or other behavior in this case. But it seems like the intended behavior is to be silent about it.

@Osmose Osmose merged commit 028dcd1 into Osmose:master Oct 4, 2017
@Osmose
Copy link
Owner

Osmose commented Oct 4, 2017

Nah, this is probably fine then. It's minor anyway.

This is out as v0.16.7 now. Thanks again!

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

Successfully merging this pull request may close these issues.

None yet

2 participants