Subject: Spyder stops showing indent guides after restart

From: local10 <[email-masked]>
Date: Sat, 14 Jan 2023 00:38:00 +0100 (CET)

Package: spyder                          
Version: 5.4.1+ds-1

Spyder stops showing indent guides after restart. To reproduce the issue:

1. Start with a clean Spyder profile, that is, remove the "/home/luser/.config/spyder-py3" dir, if  it exists
2. Start Spyder
3. Open the following file "/usr/lib/python3.10/subprocess.py"
4. Goto Menu > Source and enable the following:
    [x] Show indent guides
    [x] Show selector for classes and functions
    [x] Underline errors and warnings
5. Indent guides should be properly shown
6. Shut down Spyder
7. Start Spyer, go to tab with /usr/lib/python3.10/subprocess.py, indent guides are not shown.

Thanks

---

From: local10 <[email-masked]>
Date: Sat, 14 Jan 2023 00:53:42 +0100 (CET)

Jan 13, 2023, 23:38 by [email-masked]:

More info:

If I close the tab with "/usr/lib/python3.10/subprocess.py" file an then reopen the file again in a new tab then the indent guides will be shown again properly (until Spyder is restarted again, then they will disappear again).

---

From: Julian Gilbey <[email-masked]>
Date: Mon, 16 Jan 2023 10:29:14 +0000

forwarded 1028637 https://github.com/spyder-ide/spyder/issues/20380
thanks

> If I close the tab with "/usr/lib/python3.10/subprocess.py" file an then reopen the file again in a new tab then the indent guides will be shown again properly (until Spyder is restarted again, the…

Thanks for this report!  I've forwarded it upstream.  It also turns
out that removing the focus from Spyder and giving it back is enough
to make the guides appear.  Also, the only setting needed to trigger
this issue is to show the guides; the function/class selector and
underlining errors are unnecessary.

Best wishes,

   Julian

---

From: local10 <[email-masked]>
Date: Mon, 16 Jan 2023 14:13:09 +0100 (CET)

Jan 16, 2023, 10:29 by [email-masked]:

> to make the guides appear.
>

Not in my case. The only way I could make them appear is to close the tab (Ctrl+W) and then reopen it again (Ctrl+Shift+T). Switching the focus to another app and then back to Spyder doesn't do it for me.

> Also, the only setting needed to trigger

True but I wanted the bug report to have the configuration I used as sometimes bugs are dependent on seemingly unrelated config changes.

Regards,

---

From: Julian Gilbey <[email-masked]>
Date: Mon, 16 Jan 2023 15:10:34 +0000

> Not in my case. The only way I could make them appear is to close the tab (Ctrl+W) and then reopen it again (Ctrl+Shift+T). Switching the focus to another app and then back to Spyder doesn't do it…

Oh, that's really interesting.

If you open Spyder to the subprocess.py file and just wait (maybe 10
or 20 seconds, possibly longer), do the indent marks then appear?
They did for me, so I'm wondering if it's just that lots of processing
is happening and it takes a while for them to appear on startup.

Best wishes,

   Julian

---

From: local10 <[email-masked]>
Date: Mon, 16 Jan 2023 17:03:14 +0100 (CET)

> is happening and it takes a while for them to appear on startup.

Tried it but it didn't work for me: Opened subprocess.py in Spyder in a single tab, no other files are opened, switched focus to another app, waited ~20 seconds, back to Spyder, no indent guides still. However, switching the "Show indent guides" menu option off and then back on again brought the indent guides back (however, I know that trick doesn't work when I have 6-8 files opened in different tabs).

Pretty strange. This is what I have:

Spyder IDE: Python 3.10.9 64-bit | Qt 5.15.7 | PyQt5 5.15.7 | Linux 6.0.0-6-amd64

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.26.5  KDE Frameworks Version: 5.101.0  Qt Version: 5.15.7
Kernel Version: 6.0.0-6-amd64 (64-bit)
Graphics Platform: X11

# aptitude show python
No candidate version found for python   
Package: python
Version: 2.7.16-1
State: not installed (configuration files remain)

# aptitude show python3
Package: python3                        
Version: 3.10.6-3+b1
State: installed

Regards,

---

From: Julian Gilbey <[email-masked]>
Date: Mon, 16 Jan 2023 16:25:43 +0000

> Pretty strange. This is what I have:

OK, this is weird.  I can't see any indented blocks when I open
subprocess.py without scrolling, so I'm presuming that at some point
you scroll to see that the indented blocks?  Also, what I most
recently did wasn't quite the same as you; I did the following:

* Open Spyder - the only tab is subprocess.py
* Scroll down a bit so I can see an indented block
* Wait about 20-30 seconds
* The indented block guides appear

Could you try that and let me know what you find?

Best wishes,

   Julian

---

From: local10 <[email-masked]>
Date: Mon, 16 Jan 2023 17:48:11 +0100 (CET)

> Could you try that and let me know what you find?

Tried the above twice, the indented block guides do NOT appear for me. Flipping the "Show indent guides" menu option also doesn't bring the block guides back, not sure why it worked before.

Closing the tab and then restoring it with Ctrl+Shft+T does bring the indent guides back.

Regards,

---

From: Julian Gilbey <[email-masked]>
Date: Mon, 16 Jan 2023 17:51:43 +0000

> Closing the tab and then restoring it with Ctrl+Shft+T does bring the indent guides back.

Oh this is super weird.

I found that just waiting wasn't the thing; I needed to wait and then
move my mouse or something similar.  There's definitely something
funny here.  Hopefully the upstream developers will have some ideas.

Best wishes,

   Julian