From 1529c30e2503c4a7e776201f190377cec3a6acd2 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Fri, 15 Nov 2024 06:22:21 +0100 Subject: corfu--popup-show: Minor cleanup --- corfu.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/corfu.el b/corfu.el index 9e8b403..9051aae 100644 --- a/corfu.el +++ b/corfu.el @@ -1057,7 +1057,6 @@ A scroll bar is displayed from LO to LO+BAR." (y (if (> (+ yb (* corfu-count ch) lh lh) (frame-pixel-height)) (- yb height lh border border) yb)) - (row 0) (bmp (logxor (1- (ash 1 mr)) (1- (ash 1 bw))))) (setq left-fringe-width (if fringe ml 0) right-fringe-width (if fringe mr 0)) ;; Define an inverted corfu--bar face @@ -1075,17 +1074,15 @@ A scroll bar is displayed from LO to LO+BAR." (with-silent-modifications (delete-region (point-min) (point-max)) (apply #'insert - (cl-loop for line in lines collect - (let ((str (concat - marginl line - (if (and lo (<= lo row (+ lo bar))) - (if (eq row curr) cbar sbar) - (and (eq row curr) cmargin)) - "\n"))) + (cl-loop for row from 0 for line in lines collect + (let ((str (concat marginl line + (if (and lo (<= lo row (+ lo bar))) + (if (eq row curr) cbar sbar) + (and (eq row curr) cmargin)) + "\n"))) (when (eq row curr) (add-face-text-property 0 (length str) 'corfu-current 'append str)) - (cl-incf row) str))) (goto-char (point-min))) (setq corfu--frame (corfu--make-frame corfu--frame x y width height)))))) -- cgit v1.0