From 6caf8a271059b32bbe850ed0e056d0b235233d63 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 5 Mar 2019 11:47:15 -0500 Subject: [PATCH] Add new variable eldoc-box-fringe-use-same-bg --- README.org | 2 ++ eldoc-box.el | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 37dd03a..0d3c793 100644 --- a/README.org +++ b/README.org @@ -21,6 +21,8 @@ Get the file, add to load path, and - =eldoc-box-max-pixel-width= & =eldoc-box-max-pixel-height= :: Set them according to the screen resolution of your machine. - =eldoc-box-only-multi-line= :: Set this to non-nil and eldoc-box only display multi-line message in childframe. One line messages are left in minibuffer. - =eldoc-box-cleanup-interval= :: After this amount of seconds will eldoc-box attempt to cleanup the childframe. E.g. if it is set to 1, the childframe is cleared 1 second after you moved the point to somewhere else (that doesn't have a doc to show). This doesn't apply to =eldoc-box-hover-at-point-mode=, in that mode the childframe is cleared as soon as point moves. +- =eldoc-box-fringe-use-same-bg= :: T means fringe's background color is set to as same as that of default. Default to t. + ** Use with eglot As of writing this README, eglot doesn't have a public mode hook, use this hook: #+BEGIN_SRC emacs-lisp diff --git a/eldoc-box.el b/eldoc-box.el index ba66e78..ac751ea 100644 --- a/eldoc-box.el +++ b/eldoc-box.el @@ -113,6 +113,9 @@ if you want to dynamically change the maximum height.") This should be a function that returns a (X . Y) cons cell. It will be passes with two arguments: WIDTH and HEIGHT of the childframe.") +(defvar eldoc-box-fringe-use-same-bg t + "T means fringe's background color is set to as same as that of default.") + ;;;;; Function (defvar eldoc-box--frame nil ;; A backstage variable "The frame to display doc.") @@ -257,13 +260,16 @@ Checkout `lsp-ui-doc--make-frame', `lsp-ui-doc--move-frame'." (setq window (display-buffer-in-child-frame buffer `((child-frame-parameters . ,parameter)))) - (setq frame (window-frame window))) + (setq frame (window-frame window)) + (when eldoc-box-fringe-use-same-bg + (set-face-attribute 'fringe frame :background nil :inherit 'default))) (set-window-dedicated-p window t) (redirect-frame-focus frame (frame-parent frame)) (set-face-attribute 'internal-border frame :inherit 'eldoc-box-border) (set-face-attribute 'default frame :background (face-attribute 'eldoc-box-body :background main-frame) :font (face-attribute 'eldoc-box-body :font main-frame)) + ;; set size (let* ((size (window-text-pixel-size