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

Nui popup keeps size of first invocation

Open LukasPietzschmann opened this issue 2 years ago • 0 comments

  • Related to nui and vim.ui.select
  • OS: linux
  • Neovim version: 0.9.5

And my config looks like the following:

		input = {
			-- ...
		},
		select = {
			enabled = true,
			backend = { 'nui' },
			trim_prompt = true,
			nui = {
				position = {
					row = 2,
					col = 0,
				},
				size = false,
				relative = 'cursor',
				border = { style = 'rounded' },
				buf_options = {
					swapfile = false,
					filetype = 'DressingSelect',
				},
				win_options = { winblend = 0 },
				max_width = 80,
				max_height = 40,
				min_width = 1,
				min_height = 1,
			},
		},

I'm using the following command as an example:

:lua vim.ui.select({'a', 'b'}, {}, function(i) print(i) end)

When running the above command for the first time, I get what I would expect: Screenshot_20240221_233412 Now let's modify the command a bit.

:lua vim.ui.select({'a', 'bbbbbbbbbbbbbbbbbb', 'c'}, {}, function(i) print(i) end)

Now I get this: Screenshot_20240221_233528 The popup didn't adapt to the new content.

Any idea if that's a bug, or a misconception on my side?

LukasPietzschmann avatar Feb 21 '24 22:02 LukasPietzschmann