Skip to content

Commit e7a5144

Browse files
authored
Do not toggle dap-ui-controls-mode if posframe is not installed (#228)
1 parent 60f6c63 commit e7a5144

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dap-ui.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ DEBUG-SESSION is the debug session triggering the event."
521521
:init-value nil
522522
:global t
523523
:require 'dap-ui
524+
(unless (and (fboundp 'posframe-show)
525+
(fboundp 'posframe-hide))
526+
(error "Displaying DAP controls requires that the posframe Emacs package is installed"))
524527
(cond
525528
(dap-ui-controls-mode
526529
(add-hook 'dap-session-changed-hook 'dap-ui--update-controls)
@@ -537,8 +540,7 @@ DEBUG-SESSION is the debug session triggering the event."
537540
(remove-hook 'dap-continue-hook 'dap-ui--update-controls)
538541
(remove-hook 'dap-stack-frame-changed-hook 'dap-ui--update-controls)
539542
(setq posframe-mouse-banish t)
540-
(when (fboundp 'posframe-hide)
541-
(posframe-hide dap-ui--control-buffer)))))
543+
(posframe-hide dap-ui--control-buffer))))
542544

543545

544546
;; sessions

0 commit comments

Comments
 (0)