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

Allow preference to active file folder #72

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

debjan
Copy link

@debjan debjan commented Jun 5, 2016

There was no such option, while working folder defaults to one of opened folders.
Hopefully it's useful.

@misfo
Copy link
Owner

misfo commented Jun 9, 2016

Thanks for taking the time to open this, @debjan ! It's great to have people contributing their own pet features.

Just to clarify: is this switch supposed to force the working directory to always use the directory of the current active file (i.e. never base the directory on what folders are open)?

for folder in folders:
if active_file_name.startswith(folder):
return folder
return os.path.dirname(active_file_name)
return folders[0]
Copy link
Owner

Choose a reason for hiding this comment

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

I think we may have to handle the case where there aren't any open folders (probably just return the home dir in that case as well)

Copy link
Author

Choose a reason for hiding this comment

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

Hi @misfo, you are right - I overlooked the case where there aren't any open folders, and made new commit.

Hopefully it's fine.

Cheers

@misfo
Copy link
Owner

misfo commented Jun 9, 2016

Nevermind on the clarification above. It's pretty clear that's what you're trying to do. I just left one comment on an edge case we may have to handle. Thanks again!

debjan added 3 commits June 9, 2016 08:57
Fix for case where there aren't any open folders and simplify conditional
Didn't quite simplified in my last try
round and round i go...
@Kristinita
Copy link

@misfo , please, accept or decline this pull request.

Thanks.

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.

3 participants