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

File name not updating when closing last open file #17221

Closed
6 of 10 tasks
oscargus opened this issue Jan 20, 2022 · 3 comments
Closed
6 of 10 tasks

File name not updating when closing last open file #17221

oscargus opened this issue Jan 20, 2022 · 3 comments

Comments

@oscargus
Copy link
Contributor

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

Not really a problem, but still a bug in some sense. So if someone happens to look at that code, it can be worth keeping in mind.

When you close the last file, the file name above the file tabs are not directly updated with the new name.

What steps reproduce the problem?

  1. Close the last open file

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

The filename (with full path) should update. Now it updates when you press outside of the editor window and then inside the editor window again. (Or activate the window or try to make a screen shot...)

(When there are more files open, it updates directly, so probably it is just that the new empty file creation happens after the filename update.)

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version: 5.2.1 None
  • Python version: 3.9.9 64-bit
  • Qt version: 5.12.9
  • PyQt5 version: 5.12.3
  • Operating System: Windows 10

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  8.0.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.4.0 (OK)
keyring >=17.0.0              :  23.4.0 (OK)
nbconvert >=4.0               :  6.4.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
paramiko >=2.4.0              :  2.9.2 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0                :  2.12.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.3.2;<1.4.0          :  1.3.3 (OK)
pylsp_black >=1.0.0           :  1.0.1 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.2.1;<5.3.0      :  5.2.2 (OK)
qtpy >=1.5.0                  :  2.0.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  60.5.0 (OK)
sphinx >=0.6.6                :  4.4.0 (OK)
spyder_kernels >=2.2.0;<2.3.0 :  2.2.1 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=2.0.0            :  3.6.0.dev1376+g62978a2.d20220120 (OK)
numpy >=1.7                   :  1.22.0 (OK)
pandas >=1.1.1                :  None (NOK)
scipy >=0.17.0                :  1.7.3 (OK)
sympy >=0.7.3                 :  1.10.dev (OK)

@dalthviz
Copy link
Member

Hi @oscargus thank you for the feedback! I was able to reproduce this:

title

@Ajax-Light
Copy link
Contributor

Ajax-Light commented Jan 30, 2022

Hi, I'd like to contribute. Looks like the trigger for the file name update is the window receiving focus? I'll take a look at the PyQt5 code and figure out a way to change the trigger to be a new tab creation.
Please let me know if I'm on the right track.

@ccordoba12 ccordoba12 modified the milestones: v5.3.0, v5.3.1 Jan 30, 2022
@dalthviz
Copy link
Member

Hi @Ajax-Light thank you for wanting to help us with this! I think the method that updates the file name is connected to the Editor focus signal. I would say that what is missing is to call that method when a new file is created automatically due all the files being closed.

Let us know if you have any other questions

Ajax-Light added a commit to Ajax-Light/spyder that referenced this issue Feb 1, 2022
Fix the issue with the file name label not being updated when the
last tab is closed in the editor.
Ajax-Light added a commit to Ajax-Light/spyder that referenced this issue Feb 1, 2022
Fixes the issue with the file name label not being updated when
the last tab is closed in the editor.
@dalthviz dalthviz modified the milestones: v5.3.1, v5.3.0 Feb 1, 2022
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