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
nvim_open_win cursor-relative position depends on buffer text #21752
Comments
nvim_open_win
api, with relative = "win"
is broken!nvim_open_win
api, with relative = "win"
!
is this a regression compared to 0.8.1, i.e. did it work for you in 0.8.1 (else please say which version worked for you)?
so it looks like the issue depends on presence of text in the buffer. "nvim_open_win is broken!" is a bit much, in the future please choose a more precise issue title. |
nvim_open_win
api, with relative = "win"
!
You need to subtract by one when passing line number returned by |
No. The problem is not the line position. And I subtracted one, so this behavior was correct. The problem is column position. |
@zeertzjq, you get it wrong, the issue is still here! |
Well, I'd argue that you were first to get the minimal reproducing example wrong. First step would be to correct that. To be clear, the behavior you showed here (code + screenshots) is the expected behavior and not an error. |
If the anchored buffer text position is in a fold than the previous behavior makes even less sense. |
Ok, maybe you're right, and there was a bug that I relied on. |
Anchored buffer text position was not inside fold, but first line of the fold, which is available, as I understand. |
Describe the bug
Today I updated to Neovim v0.8.2 and my fold-preveiw plugin stopped working as it should. I haven't updated the plugin since November.
The plugin should open float window with folded region preview indented the same way the folded code is. But now all float windows are opened in the zero column. I am not the only one who faced this issue.
The plugin is quite simple and contains only one file. The code point that open a window.
I made some research and found that the
nvim_open_win
api function is broken.I open Neovim with
nvim --clean
and execute next command in different places of the bufferThe command should open the float window under the cursor. If there is a text in the place when float window should appear, then its position would be correct:
But if there is no text, then float window sticks to the last letter.
Look at the cursor position and at the float window position.
Steps to reproduce
Execute next command at the end of the most long line, so that all below lines are shorter,
Expected behavior
The floating window should open such that it left upper corner should appear one line under the cursor position.
Neovim version (nvim -v)
0.8.2
Vim (not Nvim) behaves the same?
Operating system/version
fedora 36
Terminal name/version
kitty 0.26.5
$TERM environment variable
tmux-256color
Installation
dnf
The text was updated successfully, but these errors were encountered: