Browse Source

Rename some functions in elbank-breakpoint.el

workspaces
Nicolas Petton 3 years ago
parent
commit
7c74f25fec
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
3 changed files with 9 additions and 9 deletions
  1. +4
    -4
      indium-breakpoint.el
  2. +3
    -3
      indium-interaction.el
  3. +2
    -2
      test/unit/indium-interaction-test.el

+ 4
- 4
indium-breakpoint.el View File

@ -71,7 +71,7 @@ CONDITION is true."
(map-delete indium-breakpoint--breakpoints brk)
(indium-breakpoint--remove-overlay)))
(defun indium-breakpoint-remove-all ()
(defun indium-breakpoint-remove-breakpoints-from-current-buffer ()
"Remove all breakpoints from the current buffer's file."
(indium-breakpoint--breakpoints-in-buffer-do
(lambda (_ ov)
@ -109,7 +109,7 @@ This function does not register breakpoints."
(indium-breakpoint--add-overlay brk)))
(indium-current-connection-get-breakpoints-in-file buffer-file-name)))
(defun indium-breakpoint-remove-all-overlays ()
(defun indium-breakpoint-remove-overlays-from-current-buffer ()
"Remove all breakpoint markers from the current buffer.
This function does no unset breakpoints."
(remove-overlays (point-min)
@ -175,11 +175,11 @@ When PRED is non-nil, only resolve breakpoints which satisfy (PRED brk)."
(with-current-buffer buf
(indium-breakpoint--resolve-breakpoints pred))))
(defun indium-breakpoint--unresolve-breakpoints-in-all-buffers ()
"Remove the resolution information from all breakpoints in all buffers."
(indium-breakpoint--breakpoints-in-all-buffers-do
(lambda (brk _)
(indium-breakpoint-unresolve brk))))
(defun indium-breakpoint--unresolve-all-breakpoints ()
(defun indium-breakpoint--resolve-breakpoints (&optional pred)
"Resolve breakpoints from the current buffer.
@ -231,7 +231,7 @@ If there is no overlay, make one."
;; 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-closed-hook #'indium-breakpoint--unresolve-breakpoints-in-all-buffers)
(add-hook 'indium-connection-closed-hook #'indium-breakpoint--unresolve-all-breakpoints)
;; Helpers


+ 3
- 3
indium-interaction.el View File

@ -194,7 +194,7 @@ If there is no breakpoint, signal an error."
(defun indium-remove-all-breakpoints-from-buffer ()
"Remove all breakpoints from the current buffer."
(interactive)
(indium-breakpoint-remove-all))
(indium-breakpoint-remove-breakpoints-from-current-buffer))
(defun indium-deactivate-breakpoints ()
"Deactivate all breakpoints in all buffers.
@ -328,7 +328,7 @@ hitting a breakpoint."
(defun indium-interaction-mode-off ()
"Function to be evaluated when `indium-interaction-mode' is turned off."
(indium-breakpoint-remove-all-overlays))
(indium-breakpoint-remove-overlays-from-current-buffer))
(defun indium-interaction-update ()
"Update breakpoints and script source of the current buffer."
@ -338,7 +338,7 @@ hitting a breakpoint."
(defun indium-interaction-kill-buffer ()
"Remove all breakpoints prior to killing the current buffer."
(when indium-interaction-mode
(indium-breakpoint-remove-all)))
(indium-breakpoint-remove-breakpoints-from-current-buffer)))
(defun indium-update-script-source ()
"Update the script source of the backend from the current buffer.


+ 2
- 2
test/unit/indium-interaction-test.el View File

@ -164,11 +164,11 @@
(describe "Interaction mode"
(it "should remove breakpoints when killing a buffer"
(spy-on 'indium-breakpoint-remove-all)
(spy-on 'indium-breakpoint-remove-breakpoints-from-current-buffer)
(with-js2-buffer "let a = 1;"
(indium-add-breakpoint)
(kill-buffer)
(expect #'indium-breakpoint-remove-all :to-have-been-called))))
(expect #'indium-breakpoint-remove-breakpoints-from-current-buffer :to-have-been-called))))
(provide 'indium-interaction-test)
;;; indium-interaction-test.el ends here

Loading…
Cancel
Save