-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Open file pasted into working directory toolbar #14092
Conversation
5ce53d8
to
818cbb9
Compare
Hello @impact27! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-07-28 21:55:50 UTC |
e19348f
to
1a99d07
Compare
e53ed1c
to
6514da0
Compare
Hey @impact27, sorry for missing this one and thanks for updating it. Why do you think this is a good idea? |
The usecase is: I have a python file path in my clipboard (from a failed test or something else). I want to open this file. There is a path dialog in spyder so pasting it there would make sense. It results in the cwd to be set to the folder containing the file, and the file to open. |
e0ac09b
to
808097d
Compare
b0a5b5d
to
05f3aac
Compare
05f3aac
to
a01c8ac
Compare
a01c8ac
to
cec412c
Compare
Hey @impact27, I don't know if you're aware of the
Ok, that makes sense but I don't know how discoverable this new UX could be. I understand this would be quite useful to you, but the idea is that others can benefit from it as well (of course, using the |
I guess the argument would be: what should we do if the user pastes a file in the wd box? I think that in that case, the most useful result would be to set the wd to the file dir and open the file. |
Very good point. I'm convinced that this is a nice addition, so I'll proceed to review the code. |
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
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.
Last small suggestions for you @impact27 then this should be ready code-wise.
One thing that's missing though is a test for this. Could you also add a simple one? That way we'll be sure this functionality doesn't break in the future.
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
I'll fix the problem with the Spyder 5/6 changelog files later today. So, don't worry about it. |
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.
Looks good to me now, thanks @impact27!
Description of Changes
When pasting a file location in the working directory bar, it will go to this file's directory instead of failing, and open the file in the editor. so:
/path/to/my/file.py
transforms to/path/to/my/
Issue(s) Resolved
Fixes #15254
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: