Closed yao-weijie closed 1 year ago
Thanks for your suggestions. I pushed a commit based on your code snippets.
@yao-weijie Could you check if it works for you. Also when you happy, please share your offset_x/y function setup.
I replied the mail but it seems that you didn't received it. :(
The patch works (I used the offset_y function as you put in README). And I think there are some auxiliary options is important.
" better to set the two options the same
set scrolloff=10 "
set pumheight=10 " max height of cmp menu
" lsp_signature option
" if set to false, it may still conflict with cmp at middle of window
floating_window_above_cur_line = true
I think there is still some points to improve the floating window experience. Look at the img:
If it is possible to pass a parameter to the offset_x/y function that contains the floating window size (especially height) like this? Then I think the signature help will be perfect!
I am wondering how you want to pass in the opts? How about this I add a new options
setup{
...
floating_opts=function() return {} end,
...
}
So in offset_x you can do this:
offset_x(floating_opts())
setup{ floating_window_off_y = function(opts) ... end }
the opts contains the signature help window size. Actually I'm not sure of the process of generating the help window. If help window size is calculated before offset_y, then you can pass the size to the offset_y function.
I pushed another change to allow floating_opts been passed to off_x/y. Would you take a look?
In current version, it's difficult to avoid conflict between
lsp_signature.nvim
andnvim-cmp
, especially when the cursor at the top or bottom of window, I found a solution to solve this problem.my config:
lsp_signature.setup({ ...
})