From dc287661e99cbb4f9647b78cb19a03ff91c42047 Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Tue, 11 Oct 2022 16:20:08 -0800 Subject: [PATCH] yascroll: Fix stunted scrollbar on transparent emacs. Now it's smooth --- lisp/mitch-packages.el | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index 26f56c4..5971682 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -408,9 +408,24 @@ targets." :custom-face (yascroll:thumb-text-area ((t (:inherit airline-emacs-outer)))) - (yascroll:thumb-fringe - ((t (:inherit airline-emacs-outer)))) - :config (global-yascroll-bar-mode 1)) + :config + (defun yascroll:make-thumb-overlay-fringe (left-or-right) + "Make thumb overlay on the LEFT-OR-RIGHT fringe." + (let* ((pos (point)) + ;; If `pos' is at the beginning of line, overlay of the + ;; fringe will be on the previous visual line. + (pos (if (= (line-end-position) pos) pos (1+ pos))) + ;; below originally said `filled-rectangle' instead of `empty-line'. + ;; Changed to fix transparency. + (display-string `(,left-or-right empty-line yascroll:thumb-fringe)) + (after-string (propertize "." 'display display-string)) + (overlay (make-overlay pos pos))) + (overlay-put overlay 'after-string after-string) + (overlay-put overlay 'fringe-helper t) + (overlay-put overlay 'window (selected-window)) + (overlay-put overlay 'priority yascroll:priority) + overlay)) + (global-yascroll-bar-mode 1)) ;; parentheses settingses (use-package paredit