Closed jamesaustin closed 7 months ago
This is the change that is ensuring the cursor is visible and causes the scrolling to snap back to the cursor position.
https://github.com/mawww/kakoune/commit/20a2bca52e0d159cdbab4ff6d38024cd1503a4f5
If it's a Client 'client0' got key '<scroll:3>'
event then the ensure_cursor_visible
is cleared in scroll_window
.
However when it is a Client 'client0' got key '<mouse:move:17.92>'
event then the view will snap.
Looking at the output from Kitty --debug-input
it reports only scroll
inputs. So I'm not sure where this random mouse:move
is coming from.
mouse move events can happen when the OS cursor moves over the terminal, most terminals only send those if a button is held at the same time. In any case it looks like Kakoune considers that a mouse move by itself is sufficient to make the cursor visible, which I think is indeed a bug.
I have also been seeing this issue in the foot terminal, it reproduces pretty reliably
Pushed a tentative fix but could not validate it as I have no reproducer.
Thank you!! I can confirm it resolved the issue for me with Kitty on macOS.
Version of Kakoune
Kakoune v2023.08.05-335-g610d4114
Reproducer
Outcome
The view will occasionally snap back to the cursor position and continue scrolling again.
Expectations
I would expect the view to not snap back to the location of the cursor.
Additional information
I reported the issue against Kitty - see here. The owner suggests it is more likely to be an issue with Kakoune itself.
I actually can't reproduce the issue with Kakoune and other terminals, having tested with Terminal.app, iTerm2 and Alacrity. Which seemed to suggest it was an issue with Kitty. But I also can't see any output from the Kitty logging that would cause Kakoune to snap the view back to the cursor.
Issue has been experienced for a few years and isn't new.
The issue only happens when scrolling with the trackpad, and not with the mouse.
I originally wondered if the slightly imprecise trackpad scrolling which will sometimes introduce a scroll in the x-axis might trigger the issue.
Issue experienced on macOS 14.2.1.