Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1034085: spyder: Cursor jumps somewhere else after right-clicking → selecting Format with Black or Autopep8

8 views
Skip to first unread message

Amr Ibrahim

unread,
Apr 8, 2023, 7:10:04 AM4/8/23
to
Package: spyder
Version: 5.4.2+ds-5
Severity: normal

Hello,

Steps to reproduce the bug:
0. Enable a formatter: Black or Autopep8
1. Make sure that there is something to be formatted in the code
2. Right-click somewhere in the editor and select Format with Black or Autopep8

What happens:
After formatting the file, the cursor jumps somewhere else in the editor,
usually up, changing the editor view.

What should happen:
The cursor stays where it is after formatting is done.


Best,
Amr


-- System Information:
Debian Release: 12.0
APT prefers testing-security
APT policy: (500, 'testing-security'), (500, 'testing'), (100, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-7-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages spyder depends on:
ii python3 3.11.2-1
ii python3-spyder 5.4.2+ds-5

spyder recommends no packages.

Versions of packages spyder suggests:
pn python3-spyder-unittest <none>

Versions of packages python3-spyder depends on:
ii ipython3 8.5.0-4
ii libjs-jquery 3.6.1+dfsg+~3.5.14-1
ii libjs-mathjax 2.7.9+dfsg-1
ii pyflakes3 2.5.0-1
ii pylint 2.16.2-2
ii python3 3.11.2-1
ii python3-atomicwrites 1.4.1-1
ii python3-autopep8 2.0.1-1
ii python3-chardet 5.1.0+dfsg-2
ii python3-cloudpickle 2.2.0-1
ii python3-cookiecutter 1.7.3-3
ii python3-diff-match-patch 20200713-2
ii python3-docutils 0.19+dfsg-6
ii python3-flake8 5.0.4-4
ii python3-intervaltree 3.0.2-1.1
ii python3-ipython 8.5.0-4
ii python3-jedi 0.18.2-1
ii python3-jellyfish 0.8.9-1+b4
ii python3-jsonschema 4.10.3-1
ii python3-keyring 23.9.3-2
ii python3-mccabe 0.7.0-1
ii python3-nbconvert 6.5.3-3
ii python3-numpydoc 1.5.0-1
ii python3-parso 0.8.3-1
ii python3-pexpect 4.8.0-4
ii python3-pickleshare 0.7.5-5
ii python3-pkg-resources 66.1.1-1
ii python3-psutil 5.9.4-1+b1
ii python3-pycodestyle 2.10.0-1
ii python3-pydocstyle 6.2.3-3
ii python3-pygments 2.14.0+dfsg-1
ii python3-pylint-venv 2.3.0-2
ii python3-pyls-spyder 0.4.0-2
ii python3-pylsp 1.7.1-1
ii python3-pylsp-black 1.2.1-2
ii python3-pyqt5 5.15.9+dfsg-1
ii python3-pyqt5.qtwebengine 5.15.6-1
ii python3-qdarkstyle 3.1+ds1-1
ii python3-qstylizer 0.2.2-1
ii python3-qtawesome 1.2.2+dfsg-1
ii python3-qtconsole 5.4.0-1
ii python3-qtpy 2.3.0-1
ii python3-rope 1.7.0-1
ii python3-rtree 1.0.1-1
ii python3-setuptools 66.1.1-1
ii python3-sphinx 5.3.0-4
ii python3-spyder-kernels 2.4.2-1
ii python3-textdistance 4.5.0-1
ii python3-three-merge 0.1.1-4
ii python3-watchdog 2.2.1-1
ii python3-xdg 0.28-2
ii python3-zmq 24.0.1-4+b1
ii spyder-common 5.4.2+ds-5
ii yapf3 0.32.0-1

python3-spyder recommends no packages.

Versions of packages python3-spyder suggests:
pn cython3 <none>
ii python3-matplotlib 3.6.3-1+b1
ii python3-numpy 1:1.24.2-1
pn python3-pandas <none>
ii python3-pil 9.4.0-1.1+b1
pn python3-scipy <none>
ii python3-sympy 1.11.1-1

Versions of packages python3-pyqt5 depends on:
ii libc6 2.36-8
ii libgcc-s1 12.2.0-14
ii libpython3.11 3.11.2-6
ii libqt5core5a [qtbase-abi-5-15-8] 5.15.8+dfsg-3
ii libqt5dbus5 5.15.8+dfsg-3
ii libqt5designer5 5.15.8-2
ii libqt5gui5 5.15.8+dfsg-3
ii libqt5help5 5.15.8-2
ii libqt5network5 5.15.8+dfsg-3
ii libqt5printsupport5 5.15.8+dfsg-3
ii libqt5test5 5.15.8+dfsg-3
ii libqt5widgets5 5.15.8+dfsg-3
ii libqt5xml5 5.15.8+dfsg-3
ii libstdc++6 12.2.0-14
ii python3 3.11.2-1
ii python3-pyqt5.sip 12.11.1-1

-- no debconf information

Julian Gilbey

unread,
Apr 9, 2023, 6:50:05 AM4/9/23
to
tags 1034085 + unreproducible
thanks

On Sat, Apr 08, 2023 at 01:00:04PM +0200, Amr Ibrahim wrote:
> Package: spyder
> Version: 5.4.2+ds-5
> Severity: normal
>
> Hello,
>
> Steps to reproduce the bug:
> 0. Enable a formatter: Black or Autopep8
> 1. Make sure that there is something to be formatted in the code
> 2. Right-click somewhere in the editor and select Format with Black or Autopep8
>
> What happens:
> After formatting the file, the cursor jumps somewhere else in the editor,
> usually up, changing the editor view.
>
> What should happen:
> The cursor stays where it is after formatting is done.

Dear Amr,

I have followed your instructions, but I cannot reproduce the
behaviour you describe. What I *do* observe is that the editor view
changes, but even so, the cursor remains in the same place in the
file. The bug you describe was fixed upstream a few months ago, see
https://github.com/spyder-ide/spyder/issues/19958

If you can take a screencast showing the behaviour you describe,
please do send it to this bug report and I will be able to investigate
further.

Best wishes,

Julia
n

Julian Gilbey

unread,
Apr 18, 2023, 11:40:04 AM4/18/23
to
On Sun, Apr 09, 2023 at 03:13:26PM +0200, Amr Ibrahim wrote:
>
> Am 09.04.23 um 12:15 schrieb Julian Gilbey:
> > If you can take a screencast showing the behaviour you describe,
> > please do send it to this bug report and I will be able to investigate
> > further.
>
> Hallo Julian,
>
> I run Spyder on Wayland if that matters. A screencast is attached, and the
> file (~/.config/spyder-py3/config/spyder.ini) in case it helps.

Hello Amr,

Thanks for this and sorry for the slow reply. I doubt Wayland makes
much of a difference, but this is strange behaviour which I thought
was fixed already. Would you be able to share the file you were
editing when you did this screenshot? I'd like to see if I can
reproduce it on my machine.

Best wishes,

Julian

Julian Gilbey

unread,
Apr 19, 2023, 3:20:04 PM4/19/23
to
On Tue, Apr 18, 2023 at 07:11:39PM +0200, Amr Ibrahim wrote:
> Am 18.04.23 um 17:30 schrieb Julian Gilbey:
> > > Would you be able to share the file you were editing when you did this screenshot? I'd like to see if I can reproduce it on my machine.
> > >
>
> Attached is the file.

Super, thanks - I can reproduce it on my machine (and I don't believe
I'm running Wayland). I'll report it to upstream.

Best wishes,

Julian

Julian Gilbey

unread,
Apr 19, 2023, 4:00:05 PM4/19/23
to
forwarded 1034085 https://github.com/spyder-ide/spyder/issues/20852
thanks
I did a bit more digging, and I've found the source of the problem: it
is the option Editor > Display > Wrap lines which doesn't play nicely
with autoformatting. I'm not sure exactly why, but I've reported
this.

Best wishes,

Julian
0 new messages