* bug#67333: pixel-scroll-precision: scroll-up-page gets trapped by invisible characters
@ 2023-11-21 16:24 JD Smith
2023-11-24 21:25 ` bug#67333: Additional info JD Smith
0 siblings, 1 reply; 2+ messages in thread
From: JD Smith @ 2023-11-21 16:24 UTC (permalink / raw)
To: 67333
[-- Attachment #1: Type: text/plain, Size: 2133 bytes --]
`pixel-scroll-precision-mode' is quite amazing, running 20-50x faster than other comparable pixel scrolling event callbacks. I’ve found just a few issues with it.
One issue is well-known and mentioned in the pixel-scroll.el commentary:
;; This works well almost all of the time, but is impossible to get right with images larger than
;; the window they're displayed in. A feature that will allow
;; redisplay to skip recentering is in the works, and will completely
;; resolve this problem.
When attempting to pixel-precise-scroll past an image that overfills the window height, automatic recentering causes “jump back”, and you cannot get past it. Is the mentioned “skip recentering feature” slated for Emacs 30? Would be glad to test it.
Here’s the small bug: when scrolling from the bottom up to the top of the buffer, pixel-scroll-precision-scroll-up-page gets trapped if it encounters a wrapped invisible character in the first column. By this I mean the line and cursor are pinned to the center of the window, only jiggling up and down with further scrolling in either direction. Note that this only happens when scrolling from the bottom of the buffer up to the top. Scrolling from top to bottom works fine. So there’s an asymmetry there.
A simple reproducer:
Create a new fundamental mode buffer.
Enable `pixel-scroll-precision-mode’.
Be sure you have lorem-ipsum installed, and M-100 M-x lorem-ipsum-insert-paragraphs, to insert lots of text.
M-x visual-line-mode (not required to trigger the bug, but makes it more likely).
From the beginning of buffer, run the following (via M-:) to make the 1st character of every 11th word invisible:
(cl-loop for cnt from 1 while (forward-word) for p = (point)
if (= (% cnt 11) 0) do (set-text-properties (1+ p) (+ 2 p) '(invisible t)))
Now from the bottom of the buffer, start scrolling up to the top. As point moves, it will eventually encounter an invisible character at column 0, jump immediately to the window’s center, and get stuck there, jiggling around. Scrolling neither up nor down escapes the trap.
[-- Attachment #2: Type: text/html, Size: 2998 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* bug#67333: Additional info
2023-11-21 16:24 bug#67333: pixel-scroll-precision: scroll-up-page gets trapped by invisible characters JD Smith
@ 2023-11-24 21:25 ` JD Smith
0 siblings, 0 replies; 2+ messages in thread
From: JD Smith @ 2023-11-24 21:25 UTC (permalink / raw)
To: 67333
[-- Attachment #1: Type: text/plain, Size: 837 bytes --]
I can confirm the problem is exclusively related to automatic point moves which happen during scrolling, landing on an invisible character at the start of a line. This seems to happen due to automatic redisplay point repositioning, and not line-move, for example.
I tested Po Lu’s new updates in master to pixel-scroll-precision (of Aug, 2023). With the new version, the behavior w.r.t. invisible chars has changed: when point moves to an invisible character as you scroll point towards the window's bottom, that line jumps back up to the middle of the window, but is not “trapped”: scroll can continue, and you can get past the line. As before, scrolling the other direction, from top of buffer to bottom does not place point on invisible characters and so is unaffected.
So some improvement, but still not correct.
[-- Attachment #2: Type: text/html, Size: 1130 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-24 21:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-21 16:24 bug#67333: pixel-scroll-precision: scroll-up-page gets trapped by invisible characters JD Smith
2023-11-24 21:25 ` bug#67333: Additional info JD Smith
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).