Skip to content

Commit 5450af5

Browse files
committed
Do not refresh the controls if they are already displayed
1 parent c52c1a5 commit 5450af5

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

dap-ui.el

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ request."
914914
(defun dap-ui-locals ()
915915
(interactive)
916916
(dap-ui--show-buffer (get-buffer-create dap-ui--locals-buffer))
917-
(dap-ui-locals--refresh)
917+
(dap-ui-locals--refresh-schedule)
918918
(with-current-buffer dap-ui--locals-buffer
919919
(add-hook 'dap-terminated-hook #'dap-ui-locals--refresh-schedule)
920920
(add-hook 'dap-session-changed-hook #'dap-ui-locals--refresh-schedule)
@@ -1207,21 +1207,27 @@ request."
12071207
(add-hook 'dap-breakpoints-changed-hook #'dap-ui-breakpoints--refresh)
12081208
(add-hook 'kill-buffer-hook 'dap-ui-breakpoints--cleanup-hooks nil t))
12091209

1210+
(defvar dap-ui--many-windows-displayed nil)
1211+
12101212
(defun dap-ui--show-many-windows (_session)
12111213
"Show auto configured feature windows."
1212-
(seq-doseq (feature-start-stop dap-auto-configure-features)
1213-
(when-let (start-stop (alist-get feature-start-stop dap-features->windows))
1214-
(funcall (car start-stop)))))
1214+
(unless dap-ui--many-windows-displayed
1215+
(seq-doseq (feature-start-stop dap-auto-configure-features)
1216+
(when-let (start-stop (alist-get feature-start-stop dap-features->windows))
1217+
(funcall (car start-stop))))
1218+
(setq dap-ui--many-windows-displayed t)))
12151219

12161220
(defun dap-ui--hide-many-windows (_session)
12171221
"Hide all debug windows when sessions are dead."
1218-
(seq-doseq (feature-start-stop dap-auto-configure-features)
1219-
(when-let* ((feature-start-stop (alist-get feature-start-stop dap-features->windows))
1220-
(buffer-name (symbol-value (cdr feature-start-stop))))
1221-
(when-let (window (get-buffer-window buffer-name))
1222-
(delete-window window))
1223-
(and (get-buffer buffer-name)
1224-
(kill-buffer buffer-name)))))
1222+
(when dap-ui--many-windows-displayed
1223+
(seq-doseq (feature-start-stop dap-auto-configure-features)
1224+
(when-let* ((feature-start-stop (alist-get feature-start-stop dap-features->windows))
1225+
(buffer-name (symbol-value (cdr feature-start-stop))))
1226+
(when-let (window (get-buffer-window buffer-name))
1227+
(delete-window window))
1228+
(and (get-buffer buffer-name)
1229+
(kill-buffer buffer-name))))
1230+
(setq dap-ui--many-windows-displayed nil)))
12251231

12261232
;;;###autoload
12271233
(defun dap-ui-show-many-windows ()

0 commit comments

Comments
 (0)