You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why?
When using things like LSP related pickers, I don't usually want them to take all of the space on my screen, especially things like the lsp_code_actions picker would be a lot better to use if it was smaller and relative to my cursor's position.
How would I see it implemented?
I actually already started trying to implement it. Here's the layout I had in mind:
+--------------+---------------------+
| Prompt | Previewer |
+--------------+ Previewer |
| Result | Previewer |
| Result | Previewer |
+--------------+---------------------+
With the top left being the cursor's position. The previewer would be optional, but I put it here because that's how the Visual Studio IDE displays it on code actions.
What knowledge I'm missing to make it work
As said above, I already have a branch that has the basic idea, my issue is with getting the current cursor position.
I've gone through the help and found a bunch of things like nvim_win_get_position, nvim_win_get_cursor, getline, wincol, screencol, etc.
But nothing actually allows me to get the position of the cursor on screen without counting the folds, the fact that the buffer can be scrolled, splits, tabline, sign column, line number column, etc.
If someone knows what functions to get the position or knows what functions to use and calculate the cursor position, then I'd be able to do it myself.
Another thing that I would need to know is the size of the current neovim instance, so that if the coordinates are out of bound, I can position everything at the right place. I think these are given by the lines and columns options from what I understand.
The text was updated successfully, but these errors were encountered:
I've ended up playing around with it a little bit more. I was able to get something that gets the current cursor position by using a combination of nvim_win_get_position(0), winline() and wincol().
Here's a little preview of how I want it to look (without the "preview" float for now and with a custom theme):
In the screenshot, my cursor is on the : character on the line saying "Special keys:".
I'll be able to proceed with what I have right now since it works for all of the cases I have tested for myself. Once I'm happy with it, I'll create a PR ^_^
Why?
When using things like LSP related pickers, I don't usually want them to take all of the space on my screen, especially things like the
lsp_code_actions
picker would be a lot better to use if it was smaller and relative to my cursor's position.How would I see it implemented?
I actually already started trying to implement it. Here's the layout I had in mind:
With the top left being the cursor's position. The previewer would be optional, but I put it here because that's how the Visual Studio IDE displays it on code actions.
What knowledge I'm missing to make it work
As said above, I already have a branch that has the basic idea, my issue is with getting the current cursor position.
I've gone through the help and found a bunch of things like
nvim_win_get_position
,nvim_win_get_cursor
,getline
,wincol
,screencol
, etc.But nothing actually allows me to get the position of the cursor on screen without counting the folds, the fact that the buffer can be scrolled, splits, tabline, sign column, line number column, etc.
If someone knows what functions to get the position or knows what functions to use and calculate the cursor position, then I'd be able to do it myself.
Another thing that I would need to know is the size of the current neovim instance, so that if the coordinates are out of bound, I can position everything at the right place. I think these are given by the
lines
andcolumns
options from what I understand.The text was updated successfully, but these errors were encountered: