Spyder: Cell shortcut remap not sticking on macOS

Created on 23 Feb 2020  路  15Comments  路  Source: spyder-ide/spyder

Issue Report Checklist

  • [ ] Searched the issues page for similar reports
  • [ ] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [ ] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [ ] Could not reproduce inside jupyter qtconsole (if console-related)
  • [ ] Tried basic troubleshooting (if a bug/error)

    • [ ] Restarted Spyder

    • [ ] Reset preferences with spyder --reset

    • [ ] Reinstalled the latest version of Anaconda

    • [ ] Tried the other applicable steps from the Troubleshooting Guide

  • [ ] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

When I remap Shift+Enter to run selection, and apply the changes, it does nothing when I press Shift+Enter rather than either run the selection or run all the code.

spyder: 4.0.1
spyder-kernel: 1.8.1
Operating System: OSX Catalina 10.15.3 (19D76)
PyQt5: 5.12.3

What steps reproduce the problem?

  1. Remap run select to Shift+Enter from f9 on OSX
  2. Try to run a code snippet using Shift+Enter

What is the expected output? What do you see instead?

I expect it to run selection; instead it does nothing

Paste Traceback/Error Below (if applicable)


PASTE TRACEBACK HERE

Versions

  • Spyder version:
  • Python version:
  • Qt version:
  • PyQt version:
  • Operating System name/version:

Dependencies

PASTE DEPENDENCIES HERE
Preferences Bug v4.1.0

Most helpful comment

Since I can't test it, I don't know if this is going to fix the issue here. I'm just proposing stuff to try... :P

Thanks @jnsebgosselin! It worked perfectly :)

All 15 comments

I can reproduce this. If I make the changes with spyder running and try to use it I get an Qt message on the Internal console

(QAction ambiguous shortcut or similar I forgot)

If I restart it works as expected.

Please take a look at this @steff456

I cannot reproduce on Windows on latest master.

But it seems an issue on 4.x (i didnot check master)

But it seems an issue on 4.x (i didnot check master)

On latest 4.x I cannot reproduce also.

Same Qt version? (Maybe it is an OSX issue)

@impact27 could you test if you can reproduce?

Same Qt version? (Maybe it is an OSX issue)

@impact27 could you test if you can reproduce?

No, I run Spyder on Python 3.7.3 64-bit | Qt 5.9.6 | PyQt5 5.9.2 | Windows 10

PyQt 5.12.* is not available in Anaconda, so I cannot test under that version of PyQt easily unfortunately.

@impact27 could you test if you can reproduce?

I can reproduce, I can't run selection from a keyboard shortcut.

Futhermore, the internal console prints when I try to use the shortcut:

QAction::event: Ambiguous shortcut overload: ??

And if I change to maj + R:
QAction::event: Ambiguous shortcut overload: ?R

  • Spyder version: 5.0.0.dev0 67c105d83
  • Python version: 3.7.5
  • Qt version: 5.12.6
  • PyQt5 version: 5.12.3
  • Operating System: Darwin 19.2.0

No, I run Spyder on Python 3.7.3 64-bit | Qt 5.9.6 | PyQt5 5.9.2 | Windows 10
PyQt 5.12.* is not available in Anaconda, so I cannot test under that version of PyQt easily unfortunately.

@jnsebgosselin you could use conda forge

conda create --name spyder-test spyder=4 --channel conda-forge

So the problem occurs no matter the shortcut you are using for Run selection?

Possible solution to this problem would be to set the context of the run actions to Qt.WidgetWithChildrenShortcut here :

https://github.com/spyder-ide/spyder/blob/47726b4d3d297b4bfbe6351905b6c44ef2b71e93/spyder/plugins/editor/widgets/codeeditor.py#L3581-L3603

Also, I think that the run_cell_action, run_cell_advance_action and debug_cell_action actions should be registered with register_shortcut here, because they are currently not updated during runtime, only after a restart :

https://github.com/spyder-ide/spyder/blob/47726b4d3d297b4bfbe6351905b6c44ef2b71e93/spyder/plugins/editor/plugin.py#L612-L638

@steff456 please fix this with @jnsebgosselin suggestions

@steff456 please fix this with @jnsebgosselin suggestions

Since I can't test it, I don't know if this is going to fix the issue here. I'm just proposing stuff to try... :P

No, I run Spyder on Python 3.7.3 64-bit | Qt 5.9.6 | PyQt5 5.9.2 | Windows 10
PyQt 5.12.* is not available in Anaconda, so I cannot test under that version of PyQt easily unfortunately.

@jnsebgosselin you could use conda forge

conda create --name spyder-test spyder=4 --channel conda-forge

Thanks!

Also, I think that the run_cell_action, run_cell_advance_action and debug_cell_action actions should be registered with register_shortcut here, because they are currently not updated during runtime, only after a restart :

The shortcut indeed works after a restart

Since I can't test it, I don't know if this is going to fix the issue here. I'm just proposing stuff to try... :P

Thanks @jnsebgosselin! It worked perfectly :)

Was this page helpful?
0 / 5 - 0 ratings