Skip to content

Support for Neovim#2

Draft
mcepl wants to merge 11 commits intoxyb3rt:mainfrom
openSUSE-Python:neovim
Draft

Support for Neovim#2
mcepl wants to merge 11 commits intoxyb3rt:mainfrom
openSUSE-Python:neovim

Conversation

@mcepl
Copy link

@mcepl mcepl commented Jan 9, 2026

So far it seems to work more or less fine with my Neovim 0.11.5, but I have already found one bug (see the last commit in this PR), and I would probably rather give it a bit more time (a week or so). If you are not interested in having the plugin useful for both Vim and Neovim users, just let me know, and I will gladly maintain my own Neovim only (and mostly likely Lua-only) fork.

@mcepl mcepl marked this pull request as ready for review January 21, 2026 18:39
@mcepl
Copy link
Author

mcepl commented Jan 21, 2026

I think this is actually ready for review, it has been working for me on two versions of Neovim (0.11.5 and the current master). If you are interested that is.

@mcepl mcepl marked this pull request as draft February 25, 2026 22:00
@mcepl
Copy link
Author

mcepl commented Feb 25, 2026

gx works, but the mouse right click doesn't.

We now use the WinClosed autocmd for this which means that it also
happens when using builtin vim functionality to close the window.
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: Matěj Cepl <mcepl@cepl.eu>
Using expand('<cWORD>') in s:RightRelease meant that s:Open received only
a single word, but still with the absolute column index of the mouse
click. This caused regex column matches in s:Match to fail silently.

By using getline('.'), s:Open receives the full line, ensuring that
column-based plumbing patterns (like URL detection) work correctly when
right-clicking.
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

Successfully merging this pull request may close these issues.

3 participants