summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2025-12-23 18:30:58 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2025-12-23 18:30:58 +0100
commit904c202de269d0bce1057c45b9a5a7e0b3fd2da7 (patch)
tree7bcbb91afae48867acda159604e6ae325a2f3870
parentd7c7f49bf75259b0e5332c3989239e4fe217ef3b (diff)
Minor simplificationttyborder
-rw-r--r--corfu.el4
-rw-r--r--extensions/corfu-popupinfo.el8
2 files changed, 3 insertions, 9 deletions
diff --git a/corfu.el b/corfu.el
index b3cde52..8547c92 100644
--- a/corfu.el
+++ b/corfu.el
@@ -1160,9 +1160,7 @@ A scroll bar is displayed from LO to LO+BAR."
;; parent frame (gh:minad/corfu#261).
(height (max lh (* (length lines) ch)))
(edge (window-inside-pixel-edges))
- (border (if graphic
- corfu-border-width
- (if corfu-border-on-tty 1 0)))
+ (border (cond (graphic corfu-border-width) (corfu-border-on-tty 1) (t 0)))
;; 1 border-width space when corfu-border-on-tty is non-nil
(space (if (and (not graphic) corfu-border-on-tty) border 0))
(x (max space
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el
index ce89fb5..24c40d8 100644
--- a/extensions/corfu-popupinfo.el
+++ b/extensions/corfu-popupinfo.el
@@ -313,9 +313,7 @@ form (X Y WIDTH HEIGHT DIR)."
;; Popups aligned at top
(top-aligned (or below (< (cdr ps) cfh)))
(graphic (display-graphic-p corfu--frame))
- (border (if graphic
- corfu-border-width
- (if corfu-border-on-tty 1 0)))
+ (border (cond (graphic corfu-border-width) (corfu-border-on-tty 1) (t 0)))
;; 1 border-width space when corfu-border-on-tty is non-nil
(space (if (and (not graphic) corfu-border-on-tty) border 0))
;; Horizontal display area
@@ -388,9 +386,7 @@ form (X Y WIDTH HEIGHT DIR)."
(corfu-popupinfo--hide)
(setq cand-changed nil coords-changed nil)))
(when (or cand-changed coords-changed)
- (pcase-let* ((border (if graphic
- corfu-border-width
- (if corfu-border-on-tty 1 0)))
+ (pcase-let* ((border (cond (graphic corfu-border-width) (corfu-border-on-tty 1) (t 0)))
(`(,area-x ,area-y ,area-w ,area-h ,area-d)
(corfu-popupinfo--area
(if cand-changed