emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/corfu 5b78be5 1/4: Use :align-to for scrollbar


From: Protesilaos Stavrou
Subject: [elpa] externals/corfu 5b78be5 1/4: Use :align-to for scrollbar
Date: Wed, 28 Apr 2021 15:20:37 -0400 (EDT)

branch: externals/corfu
commit 5b78be52472dacadbe809d01c84af9b19b29400a
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Use :align-to for scrollbar
---
 corfu.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/corfu.el b/corfu.el
index 383afd3..a827b0c 100644
--- a/corfu.el
+++ b/corfu.el
@@ -181,7 +181,7 @@ Set to nil in order to disable confirmation."
       (setq-local mode-line-format nil
                   header-line-format nil
                   frame-title-format ""
-                  truncate-lines nil
+                  truncate-lines t
                   cursor-type nil
                   cursor-in-non-selected-windows nil
                   show-trailing-whitespace nil
@@ -224,7 +224,7 @@ Set to nil in order to disable confirmation."
                (minibuffer . nil)
                (visibility . nil)
                (no-special-glyphs . t))))
-      (set-face-background 'internal-border (face-attribute 'corfu-border 
:background) corfu--frame)) ;; force face loading?
+      (set-face-background 'internal-border (face-attribute 'corfu-border 
:background) corfu--frame))
     (set-window-buffer (frame-root-window corfu--frame) buffer)
     (set-frame-position corfu--frame x y)
     (set-frame-size corfu--frame width height t)
@@ -236,9 +236,8 @@ Set to nil in order to disable confirmation."
          (ch (frame-char-height))
          (mw (ceiling cw 1.6))
          (margin (propertize " " 'display `(space :width (,mw))))
-         (margin-bar (concat
-                      (propertize " " 'display `(space :width (,(- mw (ceiling 
cw 4)))))
-                      (propertize " " 'face 'corfu-bar 'display `(space :width 
(,(ceiling cw 4))))))
+         (align (propertize " " 'display `(space :align-to (- right (,(ceiling 
cw 4))))))
+         (sbar (propertize " " 'face 'corfu-bar 'display `(space :width 
(,(ceiling cw 4)))))
          (width (min (cdr corfu-width-limits)
                      (/ (frame-width) 2)
                      (apply #'max (car corfu-width-limits)
@@ -251,9 +250,10 @@ Set to nil in order to disable confirmation."
      (mapconcat (lambda (line)
                   (let ((str (concat
                               margin
-                              (truncate-string-to-width line width 0 32)
+                              (truncate-string-to-width line width)
+                              align
                               (if (and lo (<= lo row (+ lo bar)))
-                                  margin-bar margin))))
+                                  sbar margin))))
                     (when (eq row curr)
                       (add-face-text-property
                        0 (length str) 'corfu-current 'append str))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]