[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu 219afe2 21/29: Deactivate fancy border if line sp
From: |
Stefan Monnier |
Subject: |
[elpa] externals/corfu 219afe2 21/29: Deactivate fancy border if line spacing is used (Fix #1) |
Date: |
Fri, 16 Apr 2021 18:44:17 -0400 (EDT) |
branch: externals/corfu
commit 219afe22caf89b8b284b90eb1023f8ba65cec9e5
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Deactivate fancy border if line spacing is used (Fix #1)
Maybe there is a better alternative to draw borders?
---
corfu.el | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/corfu.el b/corfu.el
index 0f9dc2f..5821e4f 100644
--- a/corfu.el
+++ b/corfu.el
@@ -74,18 +74,18 @@
(defface corfu-bar
'((((class color) (min-colors 88) (background dark))
- :background "#444")
+ :foreground "#444" :background "#bbb")
(((class color) (min-colors 88) (background light))
- :background "#bbb")
- (t :background "black"))
+ :foreground "#bbb" :background "#444")
+ (t :foreground "gray" :background "black"))
"Face used for the scrollbar.")
(defface corfu-border
'((((class color) (min-colors 88) (background dark))
- :background "#444")
+ :foreground "#444" :background "#444" )
(((class color) (min-colors 88) (background light))
- :background "#bbb")
- (t :background "gray"))
+ :foreground "#bbb" :background "#bbb")
+ (t :foreground "gray"))
"Face used for the border line.")
(defvar corfu-map
@@ -153,12 +153,14 @@
`(image :data ,(format "P1\n %s %s\n%s" w h
(mapconcat (lambda (_) row)
(number-sequence 1 h) ""))
:type pbm :scale 1 :ascent center
- :background ,(face-attribute color :background)
+ :background ,(face-attribute color :foreground)
:mask (heuristic (0 0 0))))))))
(defun corfu--popup (pos idx lo bar lines)
"Show LINES as popup at POS, with IDX highlighted and scrollbar between LO
and LO+BAR."
(let* ((size (corfu--char-size))
+ ;; XXX Deactivate fancy border on terminal or if line-spacing is used
+ (fancy-ui (and (not line-spacing) (display-graphic-p)))
(lborder (corfu--border (car size) (cdr size) 'corfu-border 1))
(rborder (corfu--border (car size) (cdr size) 'corfu-border -1))
(rbar (corfu--border (car size) (cdr size) 'corfu-bar (- (ceiling
(car size) 3))))
@@ -193,11 +195,15 @@
(make-overlay end end)
(make-overlay (min (+ beg col) end) (min (+ beg col width
2) end))))
(str (concat
- (propertize lborder 'face (if (= row idx) 'corfu-current
'corfu-background))
+ (if fancy-ui
+ (propertize lborder 'face (if (= row idx)
'corfu-current 'corfu-background))
+ (propertize " " 'face (if (= row idx) 'corfu-current
'corfu-background)))
line
(make-string (- width (string-width line)) 32)
- (propertize (if (and lo (<= lo row (+ lo bar))) rbar
rborder)
- 'face (if (= row idx) 'corfu-current
'corfu-background)))))
+ (if fancy-ui
+ (propertize (if (and lo (<= lo row (+ lo bar))) rbar
rborder)
+ 'face (if (= row idx) 'corfu-current
'corfu-background))
+ (propertize " " 'face (if (and lo (<= lo row (+ lo
bar))) 'corfu-bar 'corfu-border))))))
(add-face-text-property 0 (length str) (if (= row idx)
'corfu-current 'corfu-background) 'append str)
(overlay-put ov 'priority (- 1000 row))
(overlay-put ov 'window (selected-window))
- [elpa] externals/corfu 4b32521 12/29: Go back to e0198b4335add183e0673c2b224e3d6c3ac09cab for now, (continued)
- [elpa] externals/corfu 4b32521 12/29: Go back to e0198b4335add183e0673c2b224e3d6c3ac09cab for now, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu f721f1b 14/29: Properly compute character size, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 247c79b 16/29: update screenshot, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 428ef03 08/29: post-command-hook: Make the check more strict, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu e0198b4 09/29: Simplify post-command behavior, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu a497acc 10/29: Experimental border images, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 17201cd 15/29: Generate image in PBM format, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu f98d239 02/29: Add support for cycling, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu ce983a0 17/29: README: Expand configuration, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 2f9e154 18/29: Use completion--replace, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 219afe2 21/29: Deactivate fancy border if line spacing is used (Fix #1),
Stefan Monnier <=
- [elpa] externals/corfu 5bacf55 20/29: Simplifications, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu e6bfd22 26/29: Add corfu-min-width, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu a61992d 29/29: Rework popup function, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu a5fd9ad 22/29: Simplifications, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 145481d 19/29: corfu-insert: Call :exit-function, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 171b305 23/29: README: Add caveats section, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 30126c4 27/29: Add support for annotation and affixation function, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 74bc9d0 25/29: Add corfu-abort, Stefan Monnier, 2021/04/16
- [elpa] externals/corfu ab68d45 24/29: Add support for help buffer (company-location, company-doc-buffer), Stefan Monnier, 2021/04/16
- [elpa] externals/corfu 408bc11 28/29: Add corfu--completion-in-region, Stefan Monnier, 2021/04/16