Add new variable eldoc-box-fringe-use-same-bg

This commit is contained in:
Yuan Fu 2019-03-05 11:47:15 -05:00
parent 61dd07f670
commit 6caf8a2710
No known key found for this signature in database
GPG Key ID: 1CF5ECABEC37A901
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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