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

compatibility issue with realgud in normal state #511

Open
dekoponTree opened this issue Sep 28, 2023 · 5 comments
Open

compatibility issue with realgud in normal state #511

dekoponTree opened this issue Sep 28, 2023 · 5 comments
Labels
compatibility issue with meow integrating with a third-party package

Comments

@dekoponTree
Copy link
Contributor

dekoponTree commented Sep 28, 2023

I'm using realgud to debug a python program.

In source window, when I press n, the defined behavior should be move to next line as in realgud.

Whereas if meow is enabled, the behavior is broken in normal state, behaved as search next.
So far, the phenomenon is similar to the discussion

After entering the insert state, realgud behaves as predefined. But in insert state, I can't use the space key.

@dekoponTree
Copy link
Contributor Author

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; realgud

(defvar meow--realgud-setup nil)

(defun meow--realgud-hook-function ()
  "Switch meow state when entering/leaving realgud."
  (if (bound-and-true-p realgud-short-key-mode)
      (meow--switch-to-motion)
    (meow--switch-to-normal)))

(defun meow--setup-realgud (enable)
  "Setup realgud.
Argument ENABLE non-nil means turn on."
  (setq meow--realgud-setup enable)
  (if enable
      (add-hook 'realgud-short-key-mode-hook 'meow--realgud-hook-function)
    (remove-hook 'realgud-short-key-mode-hook 'meow--realgud-hook-function)))
    
(eval-after-load "realgud" (lambda () (meow--setup-realgud t)))

Above codes have no effects. I have checked that realgud-short-key-mode and realgud-short-key-mode-hook are both existent.

@dekoponTree
Copy link
Contributor Author

I have the following configuration

(eval-and-compile
  (setq use-package-always-ensure t)
  (setq use-package-always-defer t))

And I have installed realgud like this.

(use-package realgud)

After changing the installation commands into

(use-package realgud
  :demand t)

The above setup take into effects.

@dekoponTree
Copy link
Contributor Author

I have just submitted a PR, and hope it will be merged. Thanks.

@dekoponTree
Copy link
Contributor Author

After leaving realgud, meow is still in motion mode, instead of normal mode.

How to fix the patch so that meow switches to normal mode after leaving realgud?

Thanks!

@dekoponTree dekoponTree reopened this Oct 9, 2023
@DogLooksGood
Copy link
Collaborator

I think you have to find a hook or a function which is called when leaving realgud.

@eshrh eshrh added the compatibility issue with meow integrating with a third-party package label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility issue with meow integrating with a third-party package
Projects
None yet
Development

No branches or pull requests

3 participants