Browse Source

Do not update breakpoints when a script is parsed

workspaces
Nicolas Petton 4 years ago
parent
commit
0630ec343d
Signed by: nico GPG Key ID: 233587A47C207910
1 changed files with 0 additions and 20 deletions
  1. +0
    -20
      indium-breakpoint.el

+ 0
- 20
indium-breakpoint.el View File

@ -183,32 +183,12 @@ If there is no overlay, make one."
(overlay-put ov 'indium-breakpoint-ov t)
ov)))
(defun indium-breakpoint--update-after-script-parsed (script)
"Update all breakpoints in SCRIPT when is has been (re)parsed.
When a script has an associated sourcemap, the breakpoints set
its source files might be outdated."
(when (indium-script-has-sourcemap-p script)
(let* ((breakpoints (seq-filter
(lambda (brk)
(string= (indium-script-get-file script t)
(indium-breakpoint-file brk)))
(map-values (indium-current-connection-breakpoints))))
(buffers (seq-remove #'null
(seq-map (lambda (brk)
(get-file-buffer (indium-breakpoint-file brk)))
breakpoints))))
(seq-doseq (buf buffers)
(with-current-buffer buf
(indium-breakpoint--update-breakpoints-in-current-buffer))))))
(defun indium-breakpoint--update-after-script-source-set (&rest _)
"Update the breakpoints in the current buffer each time its source is set."
(indium-breakpoint--update-breakpoints-in-current-buffer))
;; Update/Restore breakpoints
(add-hook 'indium-update-script-source-hook #'indium-breakpoint--update-after-script-source-set)
(add-hook 'indium-script-parsed-hook #'indium-breakpoint--update-after-script-parsed)
(add-hook 'indium-connection-open-hook #'indium-breakpoint-restore-breakpoints-in-all-buffers)
(and (display-images-p)


Loading…
Cancel
Save