Cleaner logic on getting frame and window

This commit is contained in:
Yuan Fu 2019-02-10 13:02:56 -05:00
parent 6ce7402874
commit d5c52cb7f0
No known key found for this signature in database
GPG Key ID: 1CF5ECABEC37A901

View File

@ -247,13 +247,16 @@ Checkout `lsp-ui-doc--make-frame', `lsp-ui-doc--move-frame'."
`((default-minibuffer-frame . ,(selected-frame)) `((default-minibuffer-frame . ,(selected-frame))
(minibuffer . ,(minibuffer-window)) (minibuffer . ,(minibuffer-window))
(left-fringe . ,(frame-char-width))))) (left-fringe . ,(frame-char-width)))))
(window (or (and eldoc-box--frame (frame-selected-window eldoc-box--frame)) window frame
(display-buffer-in-child-frame
buffer
`((child-frame-parameters . ,parameter)))))
(frame (window-frame window))
(main-frame (selected-frame))) (main-frame (selected-frame)))
(make-frame-visible frame) (make-frame-visible frame)
(if eldoc-box--frame
(progn (setq frame eldoc-box--frame)
(setq window (frame-selected-window frame)))
(setq window (display-buffer-in-child-frame
buffer
`((child-frame-parameters . ,parameter))))
(setq frame (window-frame window)))
(set-window-dedicated-p window t) (set-window-dedicated-p window t)
(redirect-frame-focus frame (frame-parent frame)) (redirect-frame-focus frame (frame-parent frame))
(set-face-attribute 'internal-border frame :inherit 'eldoc-box-border) (set-face-attribute 'internal-border frame :inherit 'eldoc-box-border)