-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: master
Are you sure you want to change the base?
Conversation
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] |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
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! |
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...
@misfo , please, accept or decline this pull request. Thanks. |
There was no such option, while working folder defaults to one of opened folders.
Hopefully it's useful.