GNU bug report logs -
#39649
27.0.60; tab-line doesn't scroll
Previous Next
Reported by: João Guerra <joca.bt <at> gmail.com>
Date: Mon, 17 Feb 2020 18:53:01 UTC
Severity: normal
Found in version 27.0.60
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
This seems better to me. However, scrolling is occurring when not
necessary, which looks kinda weird https://youtu.be/_YG0XH8XJpI
On Wed, 19 Feb 2020 at 01:51, Juri Linkov <juri <at> linkov.net> wrote:
>
> >> Seems to fix the issue in a specific situation, viz. after I select a
> >> tab manually with the mouse. However, when selecting a buffer that is
> >> already visible in the tab-line the tab-line still might get scrolled
> >> or if I just scroll the tab-line and change to a non-visible buffer
> >> the tab-line doesn't get scrolled. I'm a bit interested in knowing the
> >> reasoning to not always scroll the tab-line.
> >
> > While you're manually scrolling the tab-line using the mouse wheel
> > or clicking on arrow buttons, auto-scrolling should be disabled
> > because it should not bring the current tab back into view immediately
> > on every step of manual scrolling. Just imagine that you clicked
> > on the arrow button to scroll, but it has no effect because auto-scrolling
> > immediately moved the tab-line back to its original state.
> > This is why auto-scrolling should be disabled during manual scrolling.
> >
> > Now the question: how to detect the moment when you stop manually
> > scrolling? How would you indicate that manual scrolling is finished,
> > and it's time to enable auto-scrolling to bring the currently selected tab
> > back into view? I have no idea.
>
> Actually, I have an idea - the right moment is when the current buffer
> changes on the current tab. This patch is the right way to handle this case:
>
> diff --git a/lisp/tab-line.el b/lisp/tab-line.el
> index 86ac234f3d..ad2b167e33 100644
> --- a/lisp/tab-line.el
> +++ b/lisp/tab-line.el
> @@ -464,6 +464,13 @@ tab-line-format
> (window-buffer)
> (window-parameter nil 'tab-line-hscroll)))
> (cache (window-parameter nil 'tab-line-cache)))
> + ;; Enable auto-hscroll again after it was disabled on manual scrolling.
> + ;; The moment to enable it is when the window-buffer was updated.
> + (when (and tab-line-auto-hscroll ; if auto-hscroll was enabled
> + (natnump (nth 2 cache-key)) ; non-negative on manual scroll
> + cache ; window-buffer was updated
> + (not (equal (nth 1 (car cache)) (nth 1 cache-key))))
> + (set-window-parameter nil 'tab-line-hscroll nil))
> (or (and cache (equal (car cache) cache-key) (cdr cache))
> (cdr (set-window-parameter
> nil 'tab-line-cache
This bug report was last modified 4 years and 283 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.