MunifTanjim / nui.nvim

UI Component Library for Neovim.
MIT License
1.62k stars 57 forks source link

[from noice.nvim] Anyone experience this strange indent on the menu popup? #229

Closed nyngwang closed 1 year ago

nyngwang commented 1 year ago

Hi, I just encountered a problem with noice.nvim. It seems that this is caused by nui.nvim according to the thread there but I'm not sure. Really need your help... (please forgive my copy-paste, since I believe I have provided enough context there.)


I have to type one letter to get rid of it. I don't like it.

https://user-images.githubusercontent.com/24765272/209911616-2686f8d8-2160-4fa0-9e0a-e057117a8916.mov

This is my config, if you could take a little time to test it. (As you can see, I didn't add anything related to indentation, and I only added nui into dependencies without any customization; The font I'm using is this Fantasque San Mono (Regular) maybe this is related but I'm not sure...).

(Also, it looks like the padding is applied only when my cursor moved. Not sure...)

config = function ()
  local wininfo = vim.fn.getwininfo()[1]
  local offset_top = math.floor(wininfo.height/4)
  local styles = {
    position = { col = '50%', row = offset_top },
    border = { style = 'shadow', padding = { 0, 0, 0, 0 } },
    size = { width = 100 },
  }
  require('noice').setup {
    lsp = {
      -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
      override = {
        ['vim.lsp.util.convert_input_to_markdown_lines'] = true,
        ['vim.lsp.util.stylize_markdown'] = true,
        ['cmp.entry.get_documentation'] = true,
      },
    },
    hover = { enabled = true },
    signature = { enabled = true },
    messages = { view_search = false },
    views = {
      cmdline_popup = vim.tbl_deep_extend('force', {}, styles, {
        win_options = {
          winhighlight = { Normal = 'NoiceCmdlinePopup' },
          winblend = 10,
        },
        size = { height = 2 },
      }),
      popupmenu = vim.tbl_deep_extend('force', {}, styles, {
        win_options = {
          winhighlight = { Normal = 'NoiceCmdlineItems' },
          winblend = 15,
        },
        position = { row = offset_top+3 },
        size = { height = 15 },
      }),
    },
    presets = {
      lsp_doc_border = true,
      long_message_to_split = true,
      inc_rename = true,
    },
  }
  vim.api.nvim_create_autocmd({ 'ColorScheme' }, {
    pattern = '*',
    callback = function ()
      vim.cmd([[
        hi NoiceCmdlinePopup guifg=#b8b8ff guibg=#101010
        hi NoiceCmdlineItems guifg=#c9d1d9 guibg=#101010
      ]])
    end
  })
end
MunifTanjim commented 1 year ago

I tried the exact same config and it doesn't happen for me.

If you can create a minimal reproducible issue with nui.nvim (not noice.nvim), I'd be happy to look at it further.