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

CIDER Debugger bindings are overriden by Normal Mode #13594

Open
neilyio opened this issue May 17, 2020 · 6 comments
Open

CIDER Debugger bindings are overriden by Normal Mode #13594

neilyio opened this issue May 17, 2020 · 6 comments

Comments

@neilyio
Copy link

neilyio commented May 17, 2020

Description :octocat:

Many single-key CIDER commands, like i and c for "into" and "continue" are interpreted as Normal Mode commands. Not only does this make the debugger unusable, but it makes it very easy to accidentally change the source code while you're debugging.

In the meantime, I'm using C-z to switch to Emacs state while debugging, but it took me some digging to know to do that. Until this is solved, maybe a C-z suggestion could be added to the in-buffer debugger tip?

Reproduction guide 🪲

  • Start Emacs
  • Open a .clj, run a CIDER repl with cider-jack-in-clj
  • Instrument a function with SPC u , e f
  • Run function in REPL
  • Press i or c in the debugger.

Observed behaviour: 👀 💔
Pressing n works for the debugger's "next".
Pressing i or c is overriden by Normal's "change" and "insert".

Expected behaviour: ❤️ 😄
All keypresses are passed to CIDER debugger.
Not sure I want to be able to change the source code at all while in the debugging state.

System Info 💻

  • OS: darwin
  • Emacs: 26.3
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. 1f6e39e)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: ivy
  • Layers:
(theming
 (clojure :variables clojure-enable-linters
          '(clj-kondo joker))
 html elm python markdown csharp c-c++ shell emacs-lisp git ivy dap lsp multiple-cursors
 (org :variables org-startup-indented t org-indent-mode t)
 themes-megapack version-control treemacs org-roam)
  • System configuration features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS THREADS
@practicalli-johnny
Copy link
Contributor

practicalli-johnny commented May 17, 2020

I also have this issue. In my tests keys n o h l j p q t correctly call the cider debug menu, however, c e i s call the Evil normal state commands instead.

Manually using C-z to switch to Emacs state enables the keys to work, manually switching back when the debug session is done.

\ calls evil-execute-as-emacs-state and using this before any of the keys that call evil state also makes them call the cider-debug menu keys correctly

I have uses a very simple project to test this at https://github.com/practicalli/exercism-clojure-guides/tree/master/two-fer
leiningen.org build tool and Java virtual machine are required to run the REPL for this project.

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Aug 20, 2021
@lebensterben lebensterben added Clojure Help wanted and removed stale marked as a stale issue/pr (usually by a bot) labels Aug 20, 2021
@mukeshbhakuni

This comment has been minimized.

@lebensterben
Copy link
Collaborator

One possible solution is to use evil-collection's cider-mode setup.
Sepecifically for cider-debug, see

https://github.com/emacs-evil/evil-collection/blob/95b246e8fb09d64443b8f7173e1759c1f9cd3e54/modes/cider/evil-collection-cider.el#L99-L109

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Sep 22, 2022
Repository owner deleted a comment from github-actions bot Sep 22, 2022
Repository owner deleted a comment from github-actions bot Sep 22, 2022
@lebensterben lebensterben removed the stale marked as a stale issue/pr (usually by a bot) label Sep 22, 2022
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Mar 30, 2024
@practicalli-johnny
Copy link
Contributor

practicalli-johnny commented Mar 30, 2024

Unfortunately this issue is still occurring and a noticeable error in behavior when using Spacemacs for Clojure development.

@github-actions github-actions bot removed the stale marked as a stale issue/pr (usually by a bot) label Mar 30, 2024
@smile13241324 smile13241324 self-assigned this Sep 14, 2024
fnussbaum added a commit to fnussbaum/spacemacs that referenced this issue Sep 16, 2024
fnussbaum added a commit to fnussbaum/spacemacs that referenced this issue Sep 16, 2024
Addresses syl20bnr#13594. Now the debug map should have priority over all bindings apart
from transient maps.
@fnussbaum
Copy link
Contributor

I also have this issue. In my tests keys n o h l j p q t correctly call the cider debug menu, however, c e i s call the Evil normal state commands instead.

I cannot exactly reproduce this, all of the keys call the cider bindings for me. The following existing code should indeed overwrite all default normal state bindings:

(defun spacemacs/cider-debug-setup ()
"Initialize debug mode."
(when (memq dotspacemacs-editing-style '(hybrid vim))
(evil-make-overriding-map cider--debug-mode-map 'normal)
(evil-normalize-keymaps)))

However, I think we should not only override default bindings, but should give the debug map the highest priority by using evil-make-intercept-map instead of evil-make-overriding-map. See #16579, perhaps this fixes the problem for you.

fnussbaum added a commit to fnussbaum/spacemacs that referenced this issue Sep 16, 2024
Addresses syl20bnr#13594. Now the debug map should have priority over all bindings apart
from transient maps.
smile13241324 pushed a commit that referenced this issue Sep 17, 2024
Addresses #13594. Now the debug map should have priority over all bindings apart
from transient maps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants