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

Shortcut to go to Project pane is not working #12491

Closed
7 of 10 tasks
kaleb-keny opened this issue Apr 25, 2020 · 9 comments
Closed
7 of 10 tasks

Shortcut to go to Project pane is not working #12491

kaleb-keny opened this issue Apr 25, 2020 · 9 comments

Comments

@kaleb-keny
Copy link

kaleb-keny commented Apr 25, 2020

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

The issue is with the project explorer shortcut that should be enabled with the shortcut ctrl+shift+P. This shortcut does not work when I am on a certain project and I have to go to the View-Panes to activate it.
Aside from this, as a side problem of pressing F10, which affects the layout of the screen. I need reset that layout to get the splitter unstuck. However, doing so results in the project explorer being hidden automatically. I found that closing Spyder and relaunching it from anaconda gave back the project explorer (but this doesn't work consistently). In the mean-time I am currently going to the View-Panes and re-selecting the project explorer every time I press F10 by mistake.

What steps reproduce the problem?

  1. Press Ctrl+Shit+P when project explorer is hidden

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

Toggle of project explorer pant

Paste Traceback/Error Below (if applicable)

NA

Versions

  • Spyder version: 4.1.2
  • Python version: 3.7.4
  • Qt version: 5.9.6
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 10

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.2 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.3 (OK)
sphinx >=0.6.6                 :  2.4.4 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  0.29.15 (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  1.0.3 (OK)
scipy >=0.17.0                 :  1.3.1 (OK)
sympy >=0.7.3                  :  1.5.1 (OK)
@ccordoba12
Copy link
Member

The issue is with the project explorer shortcut that should be enabled with the shortcut ctrl+shift+P. This shortcut does not work when I am on a certain project and I have to go to the View-Panes to activate it.

@dalthviz, could you verify that our default shortcuts shows the Projects pane on Windows or not? It works for me on Linux.

Aside from this, as a side problem of pressing F10, which affects the layout of the screen. I need reset that layout to get the splitter unstuck.

I don't understand what you mean by this. Please create an animated gif using the Licecap program and upload it here.

@kaleb-keny
Copy link
Author

kaleb-keny commented Apr 26, 2020

so what I meant, is by pressing F10, there is currently a bug, that makes the splitter freeze (the splitter separating the console pane from the code pane). The only way to remove the freeze on the splitter is to reset to default layout. Doing so makes the project pane disappear. Closing and reopening the project does not bring it back. The only way to do so is by doing it manually. I don't know if that is the intended behavior thought.
At the start of the screen I pressed F10, causing the splitter to shift to the left as you can see.

sample

@jitseniesen
Copy link
Member

The thing with F10 probably refers to the bug in #11875 which should be fixed in the next release.

The Ctrl+Shift+P shortcut does not do anything for me either. It is listed in the menu, so I did not redefine it. I sometimes get the message "QAction::eventFilter: Ambiguous shortcut overload: Ctrl+Shift+P" in the terminal where I start Spyder if I press Ctrl+Shift+P but not always.

The other pane shortcuts all seem to work.

This is on Debian Linux with the dev version of Spyder, master branch.

@ccordoba12
Copy link
Member

ccordoba12 commented Apr 27, 2020

Thanks @jitseniesen for the confirmation. I have two questions for you:

@ccordoba12
Copy link
Member

Another question:

  • Does the problem also happens if you start Spyder with python bootstrap.py --safe-mode?

@jitseniesen
Copy link
Member

Does the problem also happen on 4.x?

Yes

Could you go back in our git history before PR #12177 was merged and check if the problem is present there or not?

Still present. Actually, I went back to 3.x and the problem is also present there. It seems to have appeared between 3.3.0 and 3.3.1 (ancient history!)

Does the problem also happens if you start Spyder with python bootstrap.py --safe-mode?

No, that fixes the problem.

I tried out some stuff and found out that the problem only happens if I quit Spyder with a project opened and the Project pane closed, so that next time when you open Spyder the Project pane is not opened.

Here is how I can reproduce from a clean install (meaning I delete the spyder config directory), using both 4.x and master:

  1. Start Spyder
  2. Press Ctrl-Shift-P: The Project pane opens (but is empty)
  3. Open a project
  4. Close the Project pane
  5. Press Ctrl-Shift-P: The Project pane opens
  6. Close the Project pane
  7. Restart Spyder with the Project pane closed
  8. Press Ctrl-Shift-P: The Project pane does NOT open
  9. Open the Project pane using the menu
  10. Restart Spyder with the Project pane opened
  11. Close the Project pane
  12. Press Ctrl-Shift-P: The Project pane opens

Can you reproduce with these instructions?

The difference with Spyder 3.3.0 is that it always opens the Project pane, even when you restart with the Project pane close. Thus, I suspect the cause may be PR #7546 by yours truly 😊

@dalthviz
Copy link
Member

@ccordoba12 I was able to reproduce this (the shortcut not working) with the steps provided by @jitseniesen on Windows

@ccordoba12
Copy link
Member

Great! Thanks for the confirmation @dalthviz!

The difference with Spyder 3.3.0 is that it always opens the Project pane, even when you restart with the Project pane close. Thus, I suspect the cause may be PR #7546 by yours truly

Great to know. Then this one is for you @jitseniesen.

@jitseniesen
Copy link
Member

I understand what's going wrong. The function switch_to_plugin in the Project Explorer plugin, which is called when Ctrl+Shift+P is pressed, says not to switch to the plugin if Spyder is started with the project pane closed.

@ccordoba12 What is the idea behind your commit 32496f7? Why do you want should actions in the Project menu switch to the Project pane? I want to make sure that my fix respect this.

jitseniesen added a commit to jitseniesen/spyder that referenced this issue May 24, 2020
Previously new/open/close/delete project called .switch_to_plugin()
and this latter function was overridden so that the plugin is only
shown if the visible_if_project_open config option is set. This
override broke the Ctrl+Shift+P shortcut (issue spyder-ide#12491).

This commit replaces the .switch_to_plugin() override by a new
.unmaximize() function and calls this on new/open/close/delete.
As far as I can see, the unmaximize functionality is the only
part of .switch_to_plugin() that is actually used on new/open/
close/delete, because the new/open/close/delete functions have
code later to show or hide the Project plugin.
jitseniesen added a commit to jitseniesen/spyder that referenced this issue May 24, 2020
Previously new/open/close/delete project called .switch_to_plugin()
and this latter function was overridden so that the plugin is only
shown if the visible_if_project_open config option is set. This
override broke the Ctrl+Shift+P shortcut (issue spyder-ide#12491).

This commit replaces the .switch_to_plugin() override by a new
.unmaximize() function and calls this on new/open/close/delete.
As far as I can see, the unmaximize functionality is the only
part of .switch_to_plugin() that is actually used on new/open/
close/delete, because the new/open/close/delete functions have
code later to show or hide the Project plugin.
@ccordoba12 ccordoba12 changed the title Project Explorer & Project Explorer Shortcut Project shortcut is not working May 24, 2020
@ccordoba12 ccordoba12 changed the title Project shortcut is not working Shortcut to go to Project pane is not working May 24, 2020
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