folke / noice.nvim

💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu.
Apache License 2.0
4.41k stars 101 forks source link

bug: signature_help covers the current line #930

Open s1n7ax opened 2 months ago

s1n7ax commented 2 months ago

Did you check docs and existing issues?

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

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

max397574 commented 2 months ago

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.

s1n7ax commented 2 months ago

@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.

max397574 commented 2 months ago

simply create an autocmd for it

vim.api.nvim_create_autocmd({ "TextChangedI", "TextChangedP", "InsertEnter" },{
  callback=function()
    vim.lsp.buf.signature_help()  
  end
})
github-actions[bot] commented 1 month ago

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.

dpetka2001 commented 1 month ago

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.

EricDriussi commented 1 month ago

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

github-actions[bot] commented 2 weeks ago

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.

s1n7ax commented 1 week ago

.