-
-
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: Add support for other plugins in File Switcher #4290
PR: Add support for other plugins in File Switcher #4290
Conversation
spyder/widgets/fileswitcher.py
Outdated
@@ -328,7 +328,12 @@ def save_initial_state(self): | |||
for i, editor in enumerate(self.editors): | |||
if editor is self.initial_editor: | |||
self.initial_path = paths[i] | |||
self.initial_cursors[paths[i]] = editor.textCursor() | |||
# This try is needed to make the fileswitcher work with | |||
# plugins that does not have a textCursor like the notebookpuglin. |
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.
Please remove from this line like the notebookpuglin
spyder/widgets/fileswitcher.py
Outdated
try: | ||
return self.parent().get_current_editor() | ||
except AttributeError: | ||
return self.parent().get_current_client() |
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 don't like this because it would only work for the Notebook plugin.
Please change this whole block to
self.tabs.currentWidget()
because that's what get_current_editor
returns, and in NotebookPlugin
rename self.tabwidget
to self.tabs
.
That should work for both the Editor and the Notebook without specializing for any particular plugin.
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.
Sorry, there's no need to change anything in NotebookPlugin
. Just the first change, i.e.
self.tabs.currentWidget()
is enough ;-)
What happens when you write |
@ccordoba12 About the |
@ccordoba12 @dalthviz we should change the name of the plugin to just Notebook or Notebooks, having jupyter just takes up space. |
Great!! Less work to do ;-)
Since we're going to remove the notebook header, I think it's better to leave Jupyter notebook so that people can clearly identify what's the notebook provenance. |
I don't see us supporting any other type of notebook so why bother?, it also goes in line with the request I made about making shorter names for all plugins, e.g.
|
I agree it's a good idea to rename We can do the other renames for Spyder 4.0 |
Changes to make the file switcher work with the notebook plugin spyder-ide/spyder-notebook#45