Skip to content

Commit

Permalink
Make sure frame is alive before calling make-frame-invisible #162
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiencs committed Sep 9, 2022
1 parent f9cbbc7 commit 4dc0d98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions company-box-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ just grab the first candidate and press forward."

(defun company-box-doc (selection frame)
(when company-box-doc-enable
(-some-> (frame-local-getq company-box-doc-frame frame)
(make-frame-invisible))
(company-box-doc--hide frame)
(when (timerp company-box-doc--timer)
(cancel-timer company-box-doc--timer))
(setq company-box-doc--timer
Expand All @@ -161,8 +160,9 @@ just grab the first candidate and press forward."
(company-ensure-emulation-alist))))))

(defun company-box-doc--hide (frame)
(-some-> (frame-local-getq company-box-doc-frame frame)
(make-frame-invisible)))
(let ((frame (frame-local-getq company-box-doc-frame frame)))
(and (frame-live-p frame)
(make-frame-invisible frame))))

(defun company-box-doc-manually ()
(interactive)
Expand Down
3 changes: 2 additions & 1 deletion company-box.el
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ Examples:

(defun company-box--get-frame (&optional frame)
"Return the company-box child frame on FRAME."
(frame-local-getq company-box-frame frame))
(let ((frame (frame-local-getq company-box-frame frame)))
(and (frame-live-p frame) frame)))

(defsubst company-box--set-frame (frame)
"Set the frame symbol ‘company-box-frame’ to FRAME."
Expand Down

0 comments on commit 4dc0d98

Please sign in to comment.