spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.3k stars 1.61k forks source link

The editor tab switcher is not working on macOS #9508

Open jnsebgosselin opened 5 years ago

jnsebgosselin commented 5 years ago

Problem Description

As discussed in #9507, the editor tab switcher is not triggering in macOS when the go to next file and go to previous file shortcuts are pressed. Instead, pressing these shortcuts cause the editor to cycle to the next or previous file.

This is caused by the changes made in PR https://github.com/spyder-ide/spyder/pull/9400 that didn't take into account the file switcher, so that the file switcher triggering is short-circuited.

The cycling through the editor tabs should be handled by the cycle to next file and cycle to previous file shortcuts, whose default key combination are Ctrl + PgDwn and Ctrl + PgUp, not by the go to next file and go to previous file shortcuts.

jnsebgosselin commented 5 years ago

@goanpeca if you go to the shortcut preferences, can you tell me if you are able to assign Ctrl + Tab to another shortcut than the go to next file shortcut in macOS?

jnsebgosselin commented 5 years ago

Either way, I think I know what needs to be done for this to work. I can implement this in a PR and you could test it if you want.

goanpeca commented 5 years ago

@jnsebgosselin currently we cannot set those shortcuts on OSX since those keys are kinda special so you will have to set them on the config.

Now I have a broader question for @spyder-ide/core-developers

We have a file switcher we have a tab switcher and we have a tab cycle. All of these more or less do the same thing in a different way. What could we do in the spirit of keeping things simple?

Either way, I think I know what needs to be done for this to work. I can implement this in a PR and you could test it if you want.

On a normal Mac keyboard, the page up page down keys do not exist as a single key (AFAIK) so, the decision would be more, what do we prefer for Control+Tab (not Cmd) on OSX?

The tab switcher or the tab cycle?

jnsebgosselin commented 5 years ago

@jnsebgosselin currently we cannot set those shortcuts on OSX since those keys are kinda special so you will have to set them on the config.

What key combination is generally used in OSX to cycle through tabs?

goanpeca commented 5 years ago

What key combination is generally used in OSX to cycle through tabs?

Control+Tab (which is what I did following the example of chrome firefox etc... and is how it curretly works after the PR)

jnsebgosselin commented 5 years ago

What key combination is generally used in OSX to cycle through tabs?

Control+Tab (which is what I did following the example of chrome firefox etc... and is how it curretly works after the PR)

I see. Here is what I think we should do :

In Windows : everything is working fine and Ctrl + Tab and Ctrl + Shift + Tab can be assigned to any shortcut. So I think we should keep the current defaults for the go to next file, go to previous file, cycle to next file and cycle to previous file, since users can simply switch or change them if they want.

When Ctrl + Tab and Ctrl + Shift + Tab aren't assigned to any shortcut, then the default action of the Editor is to cycle through the files in Windows, like it does for the IPython console for example (Note that there is a bug currently with that in the Editor, but I'm going to report this and fix it in another Issue/PR).

In OSX: since the Ctrl + Tab and Ctrl + Shift + Tab cannot be assigned in the keyboard shortcut manager, I think we should change the default key sequences for the go to next file and go to previous file for valid ones. We should also do the same for cycle to next file and cycle to previous file, since you are saying that the default key sequences currently used for those do not exist on OSX.

I think then that what you did in PR#9400 is correct. I mean that pressing the Ctrl + Tab and Ctrl + Shift + Tab will cycle through the tabs, like it does on Windows by default in the Editor when these key sequences are not assigned to any shortcuts and like it does also in the IPython console.

goanpeca commented 5 years ago

Should I work beta4 @ccordoba12 or later?

ccordoba12 commented 5 years ago

Let's leave it for later.