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

bug: Weird Scrollbar Appears on UI

Open leehpham opened this issue 1 year ago • 7 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.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
  },
})

leehpham avatar Sep 15 '24 13:09 leehpham

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

abusch avatar Sep 16 '24 00:09 abusch

I experience the same bug.

Neovim version: 0.10.1 Operating system: Debian 12

maxkemzi avatar Sep 25 '24 12:09 maxkemzi

Same issue.

OnlyWick avatar Sep 30 '24 06:09 OnlyWick

Same issue.

hjalmarlucius avatar Oct 12 '24 12:10 hjalmarlucius

Same issue.

Raphael-Soares avatar Oct 16 '24 12:10 Raphael-Soares

Same issue.

ImmanuelKannan avatar Oct 27 '24 07:10 ImmanuelKannan

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

folke avatar Nov 02 '24 08:11 folke

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!

MikeBellika avatar Nov 08 '24 10:11 MikeBellika

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,
  },

Fricker95 avatar Nov 08 '24 14:11 Fricker95

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!

folke avatar Nov 13 '24 15:11 folke