-
Notifications
You must be signed in to change notification settings - Fork 37
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
NUI backend breaks with winbar #45
Comments
Without a repro this will be difficult to address. I just pushed up a commit that exposes more of the underlying config options for nui, and additionally sets the filetype by default to be Some other exclusions you may want to use are -- Inside a floating window
vim.api.nvim_win_get_config(0).relative ~= ""
-- Inside an unnamed buffer
vim.api.nvim_buf_get_name(0) == ""
-- Inside a non-normal buffer (e.g. quickfix, terminal, etc)
vim.api.nvim_buf_get_option(0, 'buftype') ~= "" |
Unfortunately now I have different issue with Select (code actions) and it breaks even without
My config can be installed via https://github.com/ecosse3/nvim but unfortunately I'm not able to setup Docker (Alpine Linux) with Neovim Nightly for testing (just 0.7 is available). |
Apologies, there was a small bug with my last commit. The crash should not happen anymore, and you should be able to test if the winbar logic works now. |
@stevearc Thanks. Now NUI select works with code actions. Unfortunately, it has more height than expected: With |
You can adjust the height by changing the For the vim.ui.input error, you're just going to have to change how you set the winbar. Right now you're doing it on CursorMoved, so it runs as soon as the input float window is opened, and critically, before the filetype is set. This is why I recommended using some of those other exclusion rules, like unnamed buffers or floating windows. Probably the safest thing would be to check the height of the window before setting it. Or you could wrap the call to nvim_buf_set_option with pcall to silence the error. |
@stevearc Thanks, everything works as expected now. Checking if window is floating helped fixing this error. |
Describe the bug
A clear and concise description of what the bug is.
System information
vim.ui.select
backend? If so, which one? nuiTo Reproduce
Steps to reproduce the behavior:
If possible, provide a minimal file that will trigger the issue (see
tests/manual
for examples of short ways to call
vim.ui.*
):Somehow it works good with test. Just breaks when using my config and code actions/rename.
Screenshots
Additional context
I have winbar configured with nvim 0.8 and then
nui
backed stops working and each time I try to use code action with vim.ui.select or rename with vim.ui.input it throws error.Looks like winbar is trying to be attached to nui window and it doesn't have enough space or sth like that.
I've added "DressingInput" filetype and "DressingSelect" filetype to excluded of winbar but it still doesn't work. I can tell that it works great with Telescope (which has filetype of TelescopePrompt) added to excluded filetypes.
My autocmd for winbar:
I also realized that if the error shows, sometimes "Code actions" are showing and when I click enter everything seems to work fine. Just error is showing each time:
Then press enter and it shows correctly:
Same with vim.ui.input.
Does anyone else have this issue when using winbar with nui prompt?
The text was updated successfully, but these errors were encountered: