noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

bug: signature_help covers the current line

Open s1n7ax opened this issue 1 year ago • 8 comments

Did you check docs and existing issues?

  • [X] I have read all the noice.nvim docs
  • [X] I have updated the plugin to the latest version before submitting this issue
  • [X] I have searched the existing issues of noice.nvim
  • [X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.11.0-nightly+b991319

Operating system/version

NixOS

Describe the bug

I have noticed this issue for a quite some time on LazyVim. I don't use any custom configuration for noice.nvim.

When filling parameters, signature_help is being automatically triggered and the popup covers the current line in Normal mode and in insert mode.

I can recreate this behavior with

  • vim.lsp.buf.hover()
  • vim.lsp.buf.signature_help()
  • inserting params

https://github.com/user-attachments/assets/9814a7c6-4697-43ff-813d-9ffb0f6b080b

After disabling Noice.nvim, the popup is displayed correctly.

image

I can see people have had the same issue, but solutions suggests to disable the feature. https://www.reddit.com/r/neovim/comments/ymdb5u/comment/iyhnxgy/?context=3 https://www.reddit.com/r/neovim/comments/12i9a3o/how_to_avoid_popup_covering_cursor_in_insert_mode/

Steps To Reproduce

  1. Open a lua file
  2. Use a function that has a big documentation

Expected Behavior

Pop up should be opened without covering the current line. Overflow should be scrollable.

Repro

No response

s1n7ax avatar Aug 12 '24 08:08 s1n7ax

I guess you could really just disable the functionality since something really similar (exactly the same?) is done in core now anyways.

If you don't want that you should try to create a minimal repro.

max397574 avatar Aug 12 '24 09:08 max397574

@max397574 Disabling hover and signature also removes it being auto triggered. There is some more highlights available in noice.nvim compared to the native. Mostly I miss auto trigger.

s1n7ax avatar Aug 12 '24 09:08 s1n7ax

simply create an autocmd for it

vim.api.nvim_create_autocmd({ "TextChangedI", "TextChangedP", "InsertEnter" },{
  callback=function()
    vim.lsp.buf.signature_help()  
  end
})

max397574 avatar Aug 12 '24 09:08 max397574

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Sep 12 '24 02:09 github-actions[bot]

You could just set the max_height of the message to be proportional to the window height. Something like

{
  "folke/noice.nvim",
  opts = {
    lsp = {
      signature = {
        opts = {
          size = {
            max_height = vim.api.nvim_win_get_height(0) / 2,
          },
        },
      },
    },

  }
}

should work I believe.

dpetka2001 avatar Sep 14 '24 18:09 dpetka2001

Hi there! I would also rather keep using noice for consistency with the rest of the UI.

Unfortunately the code from the comment above produces an error (Number is not an integer) and even if it did work it would break as soon as the split or window is resized. Plus this happens with width as well.

It seems to me that it might have something to do with positioning. For example even if it does fit in the window as a whole, as soon as it overflows the split it gets bumped to the top of the window.

image

EricDriussi avatar Sep 19 '24 17:09 EricDriussi

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Oct 20 '24 02:10 github-actions[bot]

.

s1n7ax avatar Oct 22 '24 04:10 s1n7ax

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Nov 22 '24 02:11 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Nov 29 '24 02:11 github-actions[bot]

This is still an issue

madflow avatar Dec 08 '24 21:12 madflow