Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Borderless cmdline popups #866

Closed
3 tasks done
Chaitanyabsprip opened this issue Jun 17, 2024 · 4 comments · Fixed by #865
Closed
3 tasks done

bug: Borderless cmdline popups #866

Chaitanyabsprip opened this issue Jun 17, 2024 · 4 comments · Fixed by #865
Labels
bug Something isn't working

Comments

@Chaitanyabsprip
Copy link

Did you check docs and existing issues?

  • I have read all the noice.nvim docs
  • I have searched the existing issues of noice.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.11.0-dev-20a7eeb

Operating system/version

archlinux 6.9.4-arch1-1

Describe the bug

With the commit 4c1efad, my existing configuration (also the configuration recipe for clean cmdline_popup) for noice.nvim started throwing errors for cmdline_popup views. The following error was thrown

....local/share/nvim/lazy/nui.nvim/lua/nui/popup/border.lua:686: text not supported for style:none

The issue is because you're setting the prompt as the popup title and nui.nvim doesn't support border text with border.style = 'none'.

Steps To Reproduce

Install noice.nvim with the provided configuration and run the command lua vim.fn.input { prompt = '>' }.

Expected Behavior

The text should either be still shown as part of the prompt or there needs to be better handling upstream. You could also just ignore the prompt text, but that would be a radical solution.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify('./.repro', ':p')

-- set stdpaths to use .repro
for _, name in ipairs { 'config', 'data', 'state', 'cache' } do
    vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

-- bootstrap lazy
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system {
        'git',
        'clone',
        '--filter=blob:none',
        'https://github.com/folke/lazy.nvim.git',
        lazypath,
    }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
    'folke/tokyonight.nvim',
    {
        'folke/noice.nvim',
        dependencies = {
            'MunifTanjim/nui.nvim',
        },
        opts = {
            views = { cmdline_popup = { border = { style = 'none', padding = { 1, 1 } } } },
        },
    },
}
require('lazy').setup(plugins, {
    root = root .. '/plugins',
})

vim.cmd.colorscheme 'tokyonight'
-- add anything else here
@Chaitanyabsprip Chaitanyabsprip added the bug Something isn't working label Jun 17, 2024
@b0ae989c
Copy link
Contributor

b0ae989c commented Jun 17, 2024

This is not a bug. nui does not support border.style = 'none' for popup window. See MunifTanjim/nui.nvim#290 (comment). Should close.

@Chaitanyabsprip
Copy link
Author

I realize it's not a bug of nui.nvim, It is a bug in how noice.nvim is setting up the options for nui.nvim. see

self._opts.border.text = self._opts.border.text or {}

this line makes noice break for me, it doesn't check for style == 'none' or handle that case in any manner, if I checkout the commit before this change, it works great

@sleeptightAnsiC
Copy link

sleeptightAnsiC commented Jun 18, 2024

This is a regression in noice.nvim

Roll-backing to 29c7f03 (4.0.1) fixes this for me (temporary ofc).

Roll-backing to b828b57 (4.1.0) should also work, unless you're using a custom position for cmdline_popup since 07e8f9c changed how said position is being handled (which seems it was later fixed in e55ce94).

@folke
Copy link
Owner

folke commented Jun 18, 2024

input uses the cmdline_input view which extends from cmdline_popup.
I just pushed a change that now always makes sure cmdline_input has a border.

If you don't want that, you need to change the view used by cmdline input. (see config)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants