folke / noice.nvim

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

bug: Weird Scrollbar Appears on UI #949

Closed leehpham closed 2 days ago

leehpham commented 2 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.10.1

Operating system/version

MacOS 14.6.1

Describe the bug

Screenshot 2024-09-15 at 9 29 09 AM

This weird scrollbar keeps randomly appearing on the UI. Once it shows up, it doesn't go away. When I quit NeoVim and reopen, it goes away but it appears again shortly.

This seems like it has something to do with the dialog box of the API doc (Shift + K shows these dialog boxes).

I'm using LazyVim by the way.

Steps To Reproduce

  1. Open a TypeScript file with Neovim.
  2. Start writing some code.
  3. View the API doc of a certain API by placing the cursor over it and press Shift + K.

Expected Behavior

The weird scrollbar shouldn't appear on the UI.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/noice.nvim", opts = {} },
    -- add any other plugins here
  },
})
abusch commented 2 months ago

Can confirm! Same neovim version and OS as the OP. I haven't been able to figure out what triggers it to appear...

maxkemzi commented 1 month ago

I experience the same bug.

Neovim version: 0.10.1 Operating system: Debian 12

OnlyWick commented 1 month ago

Same issue.

hjalmarlucius commented 1 month ago

Same issue.

Raphael-Soares commented 1 month ago

Same issue.

ImmanuelKannan commented 2 weeks ago

Same issue.

folke commented 1 week ago

I can't reproduce this and never saw this before. Please provide a step by step repro so I can look into this.

MikeBellika commented 1 week ago

I can't reproduce this and never saw this before. Please provide a step by step repro so I can look into this.

@folke Managed to get a reproduction. I think it happens in insert mode, if the API doc overflows the pane and is then dismissed by typing. Bit hard to explain with text but I got it on video:

https://github.com/user-attachments/assets/fcc78bf8-1424-42b6-ba37-ecd15e5f8f4f

Three things to see in the video:

  1. When the screen is too small vertically, the scrollbar stays (Happens at around 7 seconds)
  2. When it has enough space, no scrollbar disappears correctly (Around 30 seconds)
  3. When it doesn't have enough horizontal space, due to the split it happens again (34 seconds)

Please let me know if this doesn't make sense. The repo I used is here: https://github.com/MikeBellika/noice-scroll-repro

PS. Thank you for LazyVim, it's the best editor I've used so far!

Fricker95 commented 1 week ago

as a temporary fix, I had the same issue and i used this: views = { hover = { scrollbar = false, }, }

i don't think it fixes it completely but at least it happens only rarely now.

hopefully it'll give some insight on where the issue is coming from.

full noice config:

{
    "folke/noice.nvim",
    opts = function(_, opts)
      opts.debug = false
      opts.presets = {
        lsp_doc_border = true,
      }
      opts.views = {
        hover = {
          scrollbar = false,
        },
      }
      opts.routes = opts.routes or {}
      table.insert(opts.routes, {
        filter = {
          event = "notify",
          find = "No information available",
        },
        opts = { skip = true },
      })
      local focused = true
      vim.api.nvim_create_autocmd("FocusGained", {
        callback = function()
          focused = true
        end,
      })
      vim.api.nvim_create_autocmd("FocusLost", {
        callback = function()
          focused = false
        end,
      })

      table.insert(opts.routes, 1, {
        filter = {
          ["not"] = {
            event = "lsp",
            kind = "progress",
          },
          cond = function()
            return not focused
          end,
        },
        view = "notify_send",
        opts = { stop = false },
      })

      vim.api.nvim_create_autocmd("FileType", {
        pattern = "markdown",
        callback = function(event)
          vim.schedule(function()
            require("noice.text.markdown").keys(event.buf)
          end)
        end,
      })
      return opts
    end,
  },
folke commented 2 days ago

Was able to reproduce it with Noice history. It only happened when not using q, but closing with :close or :bd. Should be fixed now!