Skip to content
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

Keyboard shortcut for Find not working in Mac #15437

Closed
2 tasks
mpeters2 opened this issue Apr 27, 2021 · 14 comments
Closed
2 tasks

Keyboard shortcut for Find not working in Mac #15437

mpeters2 opened this issue Apr 27, 2021 · 14 comments

Comments

@mpeters2
Copy link

Issue Report Checklist

  • [Y ] Searched the issues page for similar reports
  • [Y ] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • [Y] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • [Y ] Tried basic troubleshooting (if a bug/error)
    • [Y ] Restarted Spyder
    • [Y ] Reset preferences with spyder --reset
    • [N ] Reinstalled the latest version of Anaconda
    • [Y ] Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Tried to change keyboard shortcut for "Find Next" from F3 to command-G. Preferences shows that the change has been made, but pressing command-G has no effect. I can't test to see if F3 works, as F3 is mapped to another function on my computer.

image

What steps reproduce the problem?

  1. Changed "Find Next" from F3 to Command-G

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

I expect to see the next matching item highlighted in the text editor

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version: 3.74
  • Python version: 5.0
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: OSX 10.15.7

Dependencies

PASTE DEPENDENCIES HERE

Mandatory:

applaunchservices >=0.1.7 : 0.2.1 (OK)
atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 4.0.0 (OK)
cloudpickle >=0.5.0 : 1.6.0 (OK)
cookiecutter >=1.6.0 : 1.7.2 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree >=3.0.2 : 3.1.0 (OK)
IPython >=7.6.0 : 7.22.0 (OK)
jedi =0.17.2 : 0.17.2 (OK)
jsonschema >=3.2.0 : 3.2.0 (OK)
keyring >=17.0.0 : 22.3.0 (OK)
nbconvert >=4.0 : 6.0.7 (OK)
numpydoc >=0.6.0 : 1.1.0 (OK)
parso =0.7.0 : 0.7.0 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.8.0 (OK)
pygments >=2.0 : 2.8.1 (OK)
pylint >=1.0 : 2.7.4 (OK)
pyls >=0.36.2;<1.0.0 : 0.36.2 (OK)
pyls_black >=0.4.6 : 0.4.6 (OK)
pyls_spyder >=0.3.2 : 0.3.2 (OK)
qdarkstyle =3.0.2 : 3.0.2 (OK)
qstylizer >=0.1.10 : 0.1.10 (OK)
qtawesome >=0.5.7 : 1.0.2 (OK)
qtconsole >=5.0.3 : 5.0.3 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.9.7 (OK)
setuptools >=39.0.0 : 52.0.0.post20210125 (OK)
sphinx >=0.6.6 : 3.5.3 (OK)
spyder_kernels >=2.0.1;<2.1.0 : 2.0.1 (OK)
textdistance >=4.2.0 : 4.2.1 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3;<2.0.0 : 1.0.2 (OK)
zmq >=17 : 20.0.0 (OK)

Optional:

cython >=0.21 : 0.29.23 (OK)
matplotlib >=2.0.0 : 3.3.4 (OK)
numpy >=1.7 : 1.18.1 (OK)
pandas >=1.1.1 : 1.2.4 (OK)
scipy >=0.17.0 : 1.6.2 (OK)
sympy >=0.7.3 : 1.8 (OK)

@steff456
Copy link
Member

Hi @mpeters2,

I was unable to reproduce your issue, are you using the shortcut once the find replace widget is opened?

@mpeters2
Copy link
Author

@ steff456

Yes, I'm using it once the widget is opened. After playing around with it some more, I can get it to work the first time I type something in the "find" box. Having said that, it: if there are three or more matches, pressing the short cut will highlight the second match, but will not highlight the next matches. After finding the first match, it simply doesn't seem to work any more (see screen shot below where it is stuck on the second match of "def"; the "search" menu is open to confirm that command-G has been mapped to "find next", but this result was produced by using the keyboard shortcut).

On the other hand, the "find next" down-arrow in the find widget works just fine, as does "Find Next" in the pull-down menu, so it seems to be a mapping from the keyboard to the behavior that is wonky.

image

@ccordoba12
Copy link
Member

After finding the first match, it simply doesn't seem to work any more (see screen shot below where it is stuck on the second match of "def"; the "search" menu is open to confirm that command-G has been mapped to "find next", but this result was produced by using the keyboard shortcut)

I think this is caused because the focus changes from find/replace widget (where you introduce the text to search for) to the editor. Could you check that?

@mpeters2
Copy link
Author

if I click in the text editor, the word in the search box (e.g. "def") is highlighted in gray in the source code, but command-G doesn't do anything. If I click in the search box, then one of the search terms is highlighted in light blue and the rest in gray (as in the picture post above), but command-G still doesn't do anything.

Clicking on the up and down arrow (find next and find previous) works just fine. I even tried command-G after click the arrows, and it still doesn't work.

@mrclary
Copy link
Contributor

mrclary commented Jun 10, 2021

While I cannot reproduce the OP, I'm having an issue that may be related.
The default shortcut for "run cell" (editor context) is control-return, but this is executed even when the IPython Console has focus, which is a problem because control-return in the Console should create a new line without execution.
Additionally, the "run cell and advance" shortcut (editor context) is shift-return and does not work at all.

@ccordoba12
Copy link
Member

The default shortcut for "run cell" (editor context) is control-return, but this is executed even when the IPython Console has focus, which is a problem because control-return in the Console should create a new line without execution.

I think Ctrl+Return is a global shortcut, i.e. it works for whichever pane the focus is given to.

Additionally, the "run cell and advance" shortcut (editor context) is shift-return and does not work at all.

This is weird.

@mrclary
Copy link
Contributor

mrclary commented Jun 10, 2021

I think Ctrl+Return is a global shortcut, i.e. it works for whichever pane the focus is given to.

Okay, that makes sense.

@mrclary
Copy link
Contributor

mrclary commented Jun 10, 2021

Okay, looks like all is good. As @ccordoba12 mentioned, the "run cell" and "run cell and advance" actions are also global (they reside in the Run menu). When changing these shortcuts in Spyder preferences, it is insufficient to Apply the changes or exit the preference pane; Spyder must be restarted for the Run menu to update. I modified "run cell" so as not to conflict with the IPython Console newline behavior and after restart all shortcuts work as expected, including Shift+Return to "run cell and advance".

@mpeters2, after modifying the "Find next" shortcut, did you try restarting Spyder? It worked for me without restarting Spyder, but maybe that would fix it for you.

@mpeters2
Copy link
Author

Sorry for the 11-month reply, but I still have this issue on one of my computers: an Intel iMac running Spyder 5.3. My M1 MacBook running Spyder 5.15 does not have the keyboard mapping issue.

@mpeters2
Copy link
Author

update: Since it is the same machine, but different versions of Spyder, that was giving me grief, I had a hunch that it was a corrupted preferences that was affecting each version of Spyder. So I reset the keymappings to their default, and then redid the keymappings. Now everything seems to work.

@ccordoba12
Copy link
Member

Great news @mpeters2! Closing this issue then.

@mpeters2
Copy link
Author

I take it back: that fix only worked for a short while. I came back to my computer the next morning and command-G no longer worked. I had to reset the keyboard mappings and remap command-G for Find Again.

I've got a great idea: instead of using Windows bindings, why not use Mac-native bindings? You already use it for Find and Replace, you just need to hard-wire it for Find Again.

@ccordoba12
Copy link
Member

Ok, that's a good idea. We'll take a look at it for our next release (5.3.2).

@ccordoba12 ccordoba12 reopened this May 27, 2022
@ccordoba12 ccordoba12 changed the title Keyboard shortcut not working Keyboard shortcut for Find not working in Mac May 27, 2022
@ccordoba12 ccordoba12 added this to the v5.3.2 milestone May 27, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.3.2, v5.3.3 Jun 20, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.3.3, v5.3.4 Aug 17, 2022
@ccordoba12
Copy link
Member

@mrclary, could you take a look at this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants