emacs-lsp / lsp-ui

UI integrations for lsp-mode
https://emacs-lsp.github.io/lsp-ui
GNU General Public License v3.0
1.04k stars 140 forks source link

Undefined mouse movement bindings #607

Closed Lenbok closed 3 years ago

Lenbok commented 3 years ago

I am using Emacs 28.0.50 (native compilation branch, built a couple of days ago), and lsp-ui efae00e and when I move my mouse around peripheral areas of the frame while in a lsp-enabled buffer I am getting messages appearing in minibuffer and Messages complaining about undefined bindings:

<mode-line> <mouse-movement> is undefined
<right-fringe> <mouse-movement> is undefined
<header-line> <mouse-movement> is undefined [4 times]

I'm guessing that lsp-ui has registered to be notified about mouse movement but possibly the latest emacs is allowing specific bindings for different frame areas that lsp-ui isn't set to handle. For the time being I've silenced it via:

(let ((areas '("mode-line" "left-margin" "left-fringe" "right-fringe" "header-line" "vertical-scroll-bar"))
          loc)
      (while areas
        (setq loc (pop areas))
        (global-set-key
         (kbd (concat "<" loc "> <mouse-movement>")) #'ignore)))

But that seems pretty aggressive.

jcs090218 commented 3 years ago

I currently does not have an idea for this bug so I would need you to try out something to help debug this issue. Can you try disable lsp-ui-doc-mode and see if messages disappear?

Lenbok commented 3 years ago

lsp-ui-doc-mode is already disabled. However I can't seem to reproduce this myself, so closing.

rileyrg commented 1 year ago

https://github.com/emacs-lsp/lsp-ui/assets/362891/4fa85ea6-2046-4315-af55-8ec0da1825b0

emacs 29.1 under sway, lsp commands dont work when the mouse is on my buffer. I hit the prefix and then the next key results in a undefined mouse movement error cancelling the command innvocation whether doc mode is on or off.

benjamineskola commented 11 months ago

I've encountered this bug too. It seems to particularly happen when Emacs is the active application but the mouse is outside of the Emacs frame, e.g., on another monitor. (This is Emacs 29.1 on macOS.) However, that might simply be because that's a larger area than the fringe or modeline so it's easier to trigger that way.

Disabling lsp-ui-doc-mode doesn't affect it.

dch-cap-rx commented 1 month ago

Can still confirm the presence of this in "GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu) of 2024-01-20".

The original recipe from @Lenbok above helps.