-
-
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: Added shortcut and menu option to re-run last cell #3974
Conversation
@andfoy, this one also has conflicts with 3.x. Please update it so I can merge it :-) |
spyder/config/main.py
Outdated
else: | ||
RUN_CELL_SHORTCUT = 'Ctrl+Return' | ||
RE_RUN_LAST_CELL_SHORTCUT = 'Ctrl+Shift+R' |
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.
Ctrl+Shift+...
is reserved to give focus to plugins. Please change this one to Alt+Shift+R
Could you post a screenshot to see how the new button looks? |
The icon is a bit overloaded, so I don't think we should use it for now (it took us a lot of time to come up with good icons for the run cell actions, so don't worry about it). So to finish this PR I think you need to:
|
@ccordoba12 This is ready to go |
spyder/plugins/editor.py
Outdated
@@ -105,9 +105,12 @@ def setup_page(self): | |||
|
|||
interface_group = QGroupBox(_("Interface")) | |||
newcb = self.create_checkbox | |||
fpsorting_box = newcb(_("Sort files according to full path"), | |||
'fullpath_sorting') |
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 this option. It's not need anymore in the 3.x branch.
spyder/plugins/editor.py
Outdated
showtabbar_box = newcb(_("Show tab bar"), 'show_tab_bar') | ||
|
||
interface_layout = QVBoxLayout() | ||
interface_layout.addWidget(fpsorting_box) |
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.
Also remove this.
spyder/plugins/editor.py
Outdated
@@ -539,6 +542,9 @@ def restore_scrollbar_position(self): | |||
def get_plugin_title(self): | |||
"""Return widget title""" | |||
title = _('Editor') | |||
filename = self.get_current_filename() | |||
if filename: | |||
title += ' - '+to_text_string(filename) |
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.
All these new lines are not needed either.
spyder/plugins/editor.py
Outdated
@@ -834,6 +840,17 @@ def get_plugin_actions(self): | |||
triggered=self.run_cell_and_advance, | |||
context=Qt.WidgetShortcut) | |||
|
|||
re_run_last_cell_action = create_action(self, | |||
_("Re-run last cell"), | |||
icon=ima.icon('run_cell'), |
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 leave this action without an icon.
spyder/plugins/editor.py
Outdated
run_cell_advance_action, run_selected_action, | ||
re_run_action] | ||
run_cell_advance_action, | ||
re_run_action, configure_action] |
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 configure_action
from here.
spyder/widgets/sourcecode/base.py
Outdated
def get_cell_as_executable_code(self): | ||
"""Return cell contents as executable code""" | ||
def __exec_cell(self): | ||
init_cur = QTextCursor(self.textCursor()) |
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.
Rename this variable to init_cursor
Thanks @andfoy!! I did a quick review to start with, but everything looks good to me. A test is missing but I'll add it myself after you finish my review ;-) |
spyder/plugins/editor.py
Outdated
run_selected_action, re_run_action, | ||
configure_action, MENU_SEPARATOR] | ||
self.main.run_menu_actions += run_menu_actions | ||
run_toolbar_actions = [run_action, run_cell_action, | ||
run_cell_advance_action, run_selected_action, | ||
run_cell_advance_action, |
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 for the confusion, please restore run_selected_action
here. It was fine before :-)
Fixes #3959