Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot see the breakpoint in the fringer when the debugger is started #174

Open
chmouel opened this issue Nov 29, 2024 · 1 comment
Open

Comments

@chmouel
Copy link

chmouel commented Nov 29, 2024

perhaps it's due of my configuration but I can't seem to see the breakpoint when dap started,

while the debugger stopped it shows as expected on the fringe:

image

but when dape is started the fringe gets hidden, so it makes it hard to know where is the breakpoint

image

i did quick hack to highlight the current line instead when toggling the breakpoint

image

It would be nice if you can consider adding that option to highlight the current line instead of just adding it to the fringer

here is my code that does it btw if someone else is looking for it

  (defun highlight-current-line ()
    "Highlight the current line using a custom face."
    (interactive)
    (let ((overlay (make-overlay (line-beginning-position) (line-end-position))))
      (overlay-put overlay 'face 'highlight-current-line-face)
      (overlay-put overlay 'evaporate t)))

  (defface highlight-current-line-face
    '((t (:background "grey80" :foreground "yellow")))
    "Face for highlighting the current line.")

  (defun clear-current-line-highlights ()
    "Clear all current line highlights."
    (interactive)
    (remove-overlays nil nil 'face 'highlight-current-line-face))

  (defun my-dape-breakpoint-toggle-and-hl ()
    "Add or remove breakpoint at current line."
    (interactive)
    (if (cl-member nil (dape--breakpoints-at-point)
                   :key #'dape--breakpoint-type)
        (progn
          (clear-current-line-highlights)
          (dape-breakpoint-remove-at-point))
      (progn
        (dape--breakpoint-place)
        (highlight-current-line))))
@svaante
Copy link
Owner

svaante commented Nov 30, 2024

Hey and thank you for your bug report!

Could you share the logs that dape generate and the other packages that use the fringe and/or margin. I suspect that its related to the other packages that's used.
Are you able to reproduce this independent of the number of breakpoints and where they are placed?
To generate the logs turn on logging with (setq dape-debug t) then share the contents of *dape-connection events* buffer.

Also dape already puts an overlay covering the whole line which can be reused for this purpose. The overlay category was mistakenly removed and is not present in the current elpa version but the latest commit 3a9d35e on master has it.

(put 'dape-breakpoint 'face 'highlight)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants