Indium: Replace breakpoint functions

This commit is contained in:
James Nguyen 2018-09-12 18:48:38 -07:00
parent 8307072fa0
commit 0882cd7b2d
1 changed files with 3 additions and 26 deletions

View File

@ -91,11 +91,11 @@
(when evil-collection-settings-setup-debugger-keys
(evil-collection-define-key 'normal 'indium-interaction-mode-map
[left-fringe mouse-1] 'evil-collection-indium-debugger-mouse-toggle-breakpoint
[left-margin mouse-1] 'evil-collection-indium-debugger-mouse-toggle-breakpoint
[left-fringe mouse-1] 'indium-mouse-toggle-breakpoint
[left-margin mouse-1] 'indium-mouse-toggle-breakpoint
[f5] 'indium-debugger-resume
[S-f5] 'indium-debugger-resume
[f9] 'evil-collection-indium-debugger-toggle-breakpoint
[f9] 'indium-toggle-breakpoint
[f10] 'indium-debugger-step-over
[f11] 'indium-debugger-step-into
[S-f11] 'indium-debugger-step-out))
@ -106,28 +106,5 @@
(kbd "C-j") 'indium-repl-next-input
(kbd "C-k") 'indium-repl-previous-input))
;; FIXME: It would be better for these to go upstream.
(declare-function indium-breakpoint-on-current-line-p "indium-breakpoint")
(declare-function indium-remove-breakpoint "indium-interaction")
(declare-function indium-add-breakpoint "indium-interaction")
(defun evil-collection-indium-debugger-toggle-breakpoint ()
"Toggle breakpoint at point."
(interactive)
(if (indium-breakpoint-on-current-line-p)
(call-interactively #'indium-remove-breakpoint)
(call-interactively #'indium-add-breakpoint)))
(defun evil-collection-indium-debugger-mouse-toggle-breakpoint (event)
"Toggle breakpoint at mouse EVENT click point."
(interactive "e")
(let* ((posn (event-end event))
(pos (posn-point posn)))
(when (numberp pos)
(with-current-buffer (window-buffer (posn-window posn))
(save-excursion
(goto-char pos)
(call-interactively #'evil-collection-indium-debugger-toggle-breakpoint))))))
(provide 'evil-collection-indium)
;;; evil-collection-indium.el ends here