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

Wrong key bindings in LSP UI flycheck <M-return> <return> #765

Open
farazshaikh opened this issue Mar 2, 2024 · 1 comment
Open

Wrong key bindings in LSP UI flycheck <M-return> <return> #765

farazshaikh opened this issue Mar 2, 2024 · 1 comment

Comments

@farazshaikh
Copy link

RET and return are different keys in emacs.
Binding such a M- don't work if emacs is in terminal mode.

For bindings to work both in terminal and UI. The correct binding is RET and M-RET

https://github.com/emacs-lsp/lsp-ui/blame/bc58c6664577d1d79060c6b32b7ad20e70ee19d0/lsp-ui-flycheck.el#L158
(let ((map (make-sparse-keymap)))
(define-key map (kbd "q") 'lsp-ui-flycheck-list--quit)

  • (define-key map (kbd "") 'lsp-ui-flycheck-list--view)
    -(define-key map (kbd "") 'lsp-ui-flycheck-list--visit)
  • (define-key map (kbd "") 'lsp-ui-flycheck-list--view)
    -(define-key map (kbd "") 'lsp-ui-flycheck-list--visit)

https://www.fromkk.com/posts/c-m-ret-and-return-key-in-emacs/

@farazshaikh
Copy link
Author

farazshaikh commented Mar 2, 2024

From 7035599fff1fcf69d45ee466b9a8541dfd199a86 Mon Sep 17 00:00:00 2001
From: faraz <[email protected]>
Date: Fri, 1 Mar 2024 16:42:53 -0800
Subject: [PATCH] Fix lsp-ui-flycheck-list--visit binding to M-RET

RET and return are different keys in emacs.
Binding such a M- don't work if emacs is in terminal mode.

For bindings to work both in terminal and UI. The correct binding is RET and M-RET

https://github.com/emacs-lsp/lsp-ui/blame/bc58c6664577d1d79060c6b32b7ad20e70ee19d0/lsp-ui-flycheck.el#L158
https://www.fromkk.com/posts/c-m-ret-and-return-key-in-emacs/
(cherry picked from commit 2c66ab8fd8715623bef0fdebd21aca2da706e51d)
---
 lsp-ui-flycheck.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lsp-ui-flycheck.el b/lsp-ui-flycheck.el
index e3ac831..e9a6dc6 100644
--- a/lsp-ui-flycheck.el
+++ b/lsp-ui-flycheck.el
@@ -154,8 +154,8 @@ Use `lsp-diagnostics' to receive diagnostics from your LSP server."
 (defvar lsp-ui-flycheck-list-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map (kbd "q") 'lsp-ui-flycheck-list--quit)
-    (define-key map (kbd "<return>") 'lsp-ui-flycheck-list--view)
-    (define-key map (kbd "<M-return>") 'lsp-ui-flycheck-list--visit)
+    (define-key map (kbd "<RET>") 'lsp-ui-flycheck-list--view)
+    (define-key map (kbd "<M-RET>") 'lsp-ui-flycheck-list--visit)
     map)
   "Keymap for ‘lsp-ui-flycheck-list-mode’.")
 
-- 
2.34.1

```

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

1 participant