question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spyder editing window frequently jumps when focus is lost

See original GitHub issue

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

Sometimes, in the Editor Window, I scroll a file I am editing to see another part of the file using the scroll bar (and the cursor retains its location in the file). I then change focus to another window on my screen (for example to an xterm window or to a web browser). Often, but not every time, at the point when Spyder loses the focus, in the Editor Window, the file jumps back to the last place I had my cursor (completely undoing the effect of my scrolling). (I hope that makes some sense!)

I cannot find a way of reliably reproducing this behaviour, unfortunately; it happens sporadically. It occurs (sporadically) even when I remove the Spyder preferences entirely before starting Spyder as if it’s a clean install.

Versions

  • Spyder version: 5.3.3 (pip)
  • Python version: 3.10.8 64-bit
  • Qt version: 5.15.6
  • PyQt5 version: 5.15.7
  • Operating System: Linux 6.0.0-2-amd64

Dependencies

# Mandatory:
atomicwrites >=1.2.0                   :  1.4.1 (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.0.2 (OK)
IPython >=7.31.1                       :  8.5.0 (OK)
jedi >=0.17.2;<0.19.0                  :  0.18.0 (OK)
jellyfish >=0.7                        :  0.8.9 (OK)
jsonschema >=3.2.0                     :  4.7.2 (OK)
keyring >=17.0.0                       :  23.9.3 (OK)
nbconvert >=4.0                        :  6.4.4 (OK)
numpydoc >=0.6.0                       :  1.5.0 (OK)
parso >=0.7.0;<0.9.0                   :  0.8.1 (OK)
pexpect >=4.4.0                        :  4.8.0 (OK)
pickleshare >=0.4                      :  0.7.5 (OK)
psutil >=5.3                           :  5.9.2 (OK)
pygments >=2.0                         :  2.12.0 (OK)
pylint >=2.5.0;<3.0                    :  2.15.5 (OK)
pyls_spyder >=0.4.0                    :  0.4.0 (OK)
pylsp >=1.5.0;<1.6.0                   :  1.5.0 (OK)
pylsp_black >=1.2.0                    :  1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0              :  3.0.3 (OK)
qstylizer >=0.1.10                     :  0.2.2 (OK)
qtawesome >=1.0.2                      :  1.1.1 (OK)
qtconsole >=5.3.2;<5.4.0               :  5.3.2 (OK)
qtpy >=2.1.0                           :  2.2.0 (OK)
rtree >=0.9.7                          :  1.0.1 (OK)
setuptools >=49.6.0                    :  65.5.0 (OK)
sphinx >=0.6.6                         :  4.5.0 (OK)
spyder_kernels >=2.3.3;<2.4.0          :  2.3.3 (OK)
textdistance >=4.2.0                   :  4.5.0 (OK)
three_merge >=0.1.1                    :  0.1.1 (OK)
watchdog >=0.10.3                      :  2.1.9 (OK)
xdg >=0.26                             :  0.27 (OK)
zmq >=22.1.0                           :  23.2.1 (OK)

# Optional:
cython >=0.21                          :  0.29.32 (OK)
matplotlib >=3.0.0                     :  3.5.2 (OK)
numpy >=1.7                            :  1.21.5 (OK)
pandas >=1.1.1                         :  1.3.5 (OK)
scipy >=0.17.0                         :  1.8.1 (OK)
sympy >=0.7.3                          :  1.10.1 (OK)

# Spyder plugins:
spyder_boilerplate.spyder.plugin 0.0.1 :  0.0.1 (OK)
spyder_unittest.unittestplugin 0.5.1   :  0.5.1 (OK)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dalthvizcommented, Oct 31, 2022

Thanks for the new info @juliangilbey ! Then I think Spyder is detecting the Alt keystroke (maybe also other key modifiers?) and then because of that putting the focus on the cursor Editor. In my example, I tried to replicate the scroll jump by pressing my keyboard spacebar. So I guess the problem is that this scroll jump behavior is happening by pressing not only keys that input things in the Edior (like spacebar, letters or numbers) but also keys like Alt

We will check it in a future release 👍🏼

0reactions
ccordoba12commented, Dec 8, 2022

Ok, no problem, there’s no rush because this is not a critical issue. Moving it to 5.4.2 then.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editor loses cursor focus after running cell when IPython ...
Normally, when all the Spyder panes are in a single window, running a cell (ctrl-enter) produces the desired output in the IPython console ......
Read more >
Sypder 2 IDE - keep the focus in the editor after sending ...
The main thing that annoys me is that every time I select some python commands to send to my Python command line, the...
Read more >
Debugger — Spyder 5 documentation
A Spyder IPython console window, showing debugging from toolbar. Additionally, the Editor shows the line of code the debugger is currently stopped on...
Read more >
1. Python Basics - Foundations for Analytics with Python [Book]
Open the Spyder IDE or a text editor (e.g., Notepad, Notepad++, or Sublime Text on Windows; TextMate, TextWrangler, or Sublime Text on macOS)....
Read more >
Forza Horizon 5 updates: Known issues, bugs, update ...
Here's every known issue and bug in Forza Horizon 5, alongside all the updates and changelogs working to fix them.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found