Skip to content

Commit 450ef66

Browse files
committed
Run dap-breakpoints-changed-hook only if file is visited
1 parent d8e9bcc commit 450ef66

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dap-mode.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,9 @@ PARAMS are the event params.")
956956
breakpoints)))
957957
(cl-first))))
958958
(when (eq debug-session (dap--cur-session))
959-
(with-current-buffer (find-file file-name)
960-
(run-hooks 'dap-breakpoints-changed-hook)))))
959+
(when-let (buffer (find-buffer-visiting file-name))
960+
(with-current-buffer buffer
961+
(run-hooks 'dap-breakpoints-changed-hook))))))
961962
("thread" (-let [(&hash "threadId" id "reason") body]
962963
(puthash id reason (dap--debug-session-thread-states debug-session))
963964
(run-hooks 'dap-session-changed-hook)

0 commit comments

Comments
 (0)