[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/corfu-doc fd15093639 05/95: Add left and right margins
From: |
ELPA Syncer |
Subject: |
[elpa] externals/corfu-doc fd15093639 05/95: Add left and right margins |
Date: |
Tue, 19 Jul 2022 15:57:59 -0400 (EDT) |
branch: externals/corfu-doc
commit fd1509363909d2b8f8dad335744490735887f77a
Author: Tian Yuwei <ibluefocus@outlook.com>
Commit: Tian Yuwei <ibluefocus@outlook.com>
Add left and right margins
---
corfu-doc.el | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/corfu-doc.el b/corfu-doc.el
index c33b6c5e65..bbcb107851 100644
--- a/corfu-doc.el
+++ b/corfu-doc.el
@@ -63,6 +63,16 @@
(defvar corfu-doc--frame nil
"Doc frame.")
+(defvar corfu-doc--frame-parameters
+ (let* ((cw (default-font-width))
+ (lm (* cw corfu-left-margin-width))
+ (rm (* cw corfu-right-margin-width)))
+ (map-merge 'alist
+ corfu--frame-parameters
+ `((left-fringe . ,(ceiling lm))
+ (right-fringe . ,(ceiling rm)))))
+ "Default doc child frame parameters.")
+
(defvar corfu-doc--window nil
"Current window corfu is in.")
@@ -89,6 +99,7 @@
(use-local-map corfu--mouse-ignore-map)
(dolist (var corfu--buffer-parameters)
(set (make-local-variable (car var)) (cdr var)))
+ (setq-local indicate-empty-lines nil)
(setq-local face-remapping-alist (copy-tree fr))
(cl-pushnew 'corfu-default (alist-get 'default face-remapping-alist))
(let ((inhibit-modification-hooks t)
@@ -117,7 +128,7 @@
(getenv "DESKTOP_SESSION")
""))
'resize-mode)))
(after-make-frame-functions)
- (border (alist-get 'child-frame-border-width corfu--frame-parameters))
+ (border (alist-get 'child-frame-border-width
corfu-doc--frame-parameters))
(buffer (corfu-doc--make-buffer content)))
(unless (and (frame-live-p corfu-doc--frame)
(eq (frame-parent corfu-doc--frame) (window-frame)))
@@ -128,7 +139,7 @@
(line-spacing . ,line-spacing)
;; Set `internal-border-width' for Emacs 27
(internal-border-width . ,border)
- ,@corfu--frame-parameters))))
+ ,@corfu-doc--frame-parameters))))
;; XXX HACK Setting the same frame-parameter/face-background is not a nop
(BUG!).
;; Check explicitly before applying the setting.
;; Without the check, the frame flickers on Mac.
@@ -141,7 +152,11 @@
(set-face-background face internal-border-color corfu-doc--frame)
;; XXX HACK We have to apply the face background before adjusting the
frame parameter,
;; otherwise the border is not updated (BUG!).
- (set-frame-parameter corfu-doc--frame 'background-color bg-color)))
+ (set-frame-parameter corfu-doc--frame 'background-color bg-color))
+ ;; set fringe color
+ (unless (equal (face-attribute 'fringe :background corfu-doc--frame
'default)
+ bg-color)
+ (set-face-background 'fringe bg-color corfu-doc--frame)))
(let ((win (frame-root-window corfu-doc--frame)))
(set-window-buffer win buffer)
;; Mark window as dedicated to prevent frame reuse (#60)
@@ -187,8 +202,12 @@
(cl-subseq (frame-edges cf-parent-frame 'inner) 0 2))
(cf-parent-frame-width (frame-pixel-width cf-parent-frame))
(cf-doc-frame-width
- ;; left-border + inner width + right border
- (+ 1 (* (frame-char-width) corfu-doc-max-width) 1))
+ ;; left border + left margin + inner width + right margin +
right-border
+ (+ 1
+ (alist-get 'left-fringe corfu-doc--frame-parameters 0)
+ (* (frame-char-width) corfu-doc-max-width)
+ (alist-get 'right-fringe corfu-doc--frame-parameters 0)
+ 1))
(cf-doc-frame-height (* (frame-char-height) corfu-doc-max-height))
(display-width
(nth 3 (assq 'geometry (car (display-monitor-attributes-list)))))
- [elpa] externals/corfu-doc 07d389a0ab 74/95: Make candidates popup and doc popup share the border, (continued)
- [elpa] externals/corfu-doc 07d389a0ab 74/95: Make candidates popup and doc popup share the border, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 832b49e2a1 83/95: Remove :safe args, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc be90c96079 84/95: Merge functions to get the documentation of the candidate, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 13574ae5d1 82/95: Make corfu-doc-display-within-parent-frame default to t, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 616a2a9fc6 93/95: Fix regression error when scrolling doc popup, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 767e7574ef 89/95: Obsolete toggle-corfu-doc-mode command, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc da93136780 95/95: Increase the default max width of the doc frame to 80 characters, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 8e463cccad 11/95: Fix #4: add requirement for map library, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc b8b47f79bc 03/95: Make the documentation scrollable, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc d2260b04d7 04/95: Fix doc frame border missing problem, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc fd15093639 05/95: Add left and right margins,
ELPA Syncer <=
- [elpa] externals/corfu-doc c6b54c923e 14/95: Add command to quickly toggle documentation popup on or off, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 98398c61fa 15/95: Fix wrong argument type error when calling frame-visible-p, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc e18aea61e7 10/95: Version 0.0.3, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 98509cbe29 44/95: Decrease auto delay to 0.1, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 0741012875 26/95: Fix typo in comment, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 8c30a44d67 41/95: Fix #7: change the behavior of the corfu-doc-toggle command, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc f83307a233 09/95: Update doc frame when corfu frame coordinates changed, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 488da67753 13/95: Revert previous commit, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc ef1edadb4f 29/95: README: Document `corfu-doc-delay`, ELPA Syncer, 2022/07/19
- [elpa] externals/corfu-doc 5d08342a82 28/95: Fix #6: do not show the documentation popup immediately, ELPA Syncer, 2022/07/19