Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll bar hides during and after editing #38

Open
ghost opened this issue Feb 8, 2022 · 7 comments
Open

Scroll bar hides during and after editing #38

ghost opened this issue Feb 8, 2022 · 7 comments

Comments

@ghost
Copy link

ghost commented Feb 8, 2022

Editing a line causes the scroll bar to disappear until the window is scrolled again. It would be nice if it remained visible, and even correctly adjusted itself to the new buffer size and position, if those had changed.

Currently I'm using (defun yascroll:before-change (beg end) nil) as a quick hack to prevent the hiding, but that doesn't update the scroll bar size and position.

@jcs090218
Copy link
Collaborator

Try set the variable yascroll:delay-to-hide to nil.

@ghost
Copy link
Author

ghost commented Feb 8, 2022

Already done - the same behavior persists. To clarify, the issue is not the automatic hiding after a delay, but specifically editing a buffer that causes the hiding, regardless of time elapsed since last scroll.

@jcs090218
Copy link
Collaborator

Can you try the latest version and see if that works? See #39.

@ghost
Copy link
Author

ghost commented Feb 8, 2022

Works flawlessly - thank you : )

@ghost ghost closed this as completed Feb 8, 2022
@ghost
Copy link
Author

ghost commented Feb 8, 2022

If only it were that easy. Use of the patched version revealed a performance issue when used with helm-swoop.

Calling helm-swoop is very slow with the patched yascroll version, but quick with the previous version. That is, it takes a long time for the helm-swoop window to open - subsequent searching within the window remains fast. It takes a long time to open regardless if it is the 1st time or not being opened during a session. I.e. it'll be just as slow the 2nd, 3rd, etc.. time it is called.

My guess is that it is expensive to re-render the scroll-bar for each of the many editing operations helm-swoop does to set-up its buffer.

Tested on Emacs 27.1, launched with emacs -q to start with a clean slate, and the following script was loaded with M-x load-file:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-install 'helm)
(require 'helm)

;; Old version, without patch to prevent scroll-bar hiding due to edit.
;; helm-swoop opens fast with this version.
(require 'yascroll)
;; New version, that persists the scroll-bar during edit operations.
;; helm-swoop opens very slowly this version, especially for larger files.
; (load-file "~/yascroll-test/yascroll.el")

(global-yascroll-bar-mode 1)
(setq-default yascroll:delay-to-hide nil)

@ghost ghost reopened this Feb 8, 2022
@dears1rr
Copy link

dears1rr commented Apr 23, 2022

I have the same problem as @FuzzyWuzzyBMP, the update made some major modes very slow, like efleed or mingus (mpd controller). I had to remove (setq-default yascroll:delay-to-hide nil) to make it work again.

@philc
Copy link

philc commented Jan 3, 2023

Setting yascroll:delay-to-hide to nil makes building the buffer shown by magit-log-mode slow. I don't need yascroll in magit buffers, so this solved it for me: (setq yascroll:disabled-modes '(magit-log-mode))

philc added a commit to philc/emacs-config that referenced this issue Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants