Fix right-click mouse support for Neovim 0.12+#2
Draft
Conversation
In Neovim 0.12+, normal! with mouse key events (<LeftMouse>, <LeftRelease>) is restricted and cannot be used to replay mouse events. This caused E492 errors in s:RightRelease. Fixes: - s:MousePress: use wincmd w + cursor() for Neovim instead of normal! \<LeftMouse> - s:MiddleRelease: skip normal! \<LeftRelease> for Neovim - s:RightRelease: skip normal! \<LeftRelease> for Neovim (root cause of the reported E492 error in issue #1) Co-authored-by: mcepl <198999+mcepl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix right mouse click jump functionality for Neovim
Fix right-click mouse support for Neovim 0.12+
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Neovim 0.12+, mouse events cannot be replayed via
normal!— callingexe "normal! \<LeftRelease>"insides:RightReleasecaused an E492 error that aborted function execution, breaking all right-click navigation.Changes
s:MousePress: Replaceexe "normal! \<LeftMouse>"with an explicitwincmd w+cursor()call using thegetmousepos()data already stored ins:click. Neovim'sgetmousepos().columnis 1-based, matchingcursor()'s convention.s:MiddleRelease/s:RightRelease: Guardexe "normal! \<LeftRelease>"with!has('nvim'). In Neovim, cursor position is already correct from the press handler; drag-based visual selection is covered by the existing<RightDrag>→<LeftDrag>remap.Vim behavior is unchanged.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
neovim.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.