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

heirline, wilder and winbar #49

Closed
DrKGD opened this issue Aug 11, 2022 · 4 comments · Fixed by #157
Closed

heirline, wilder and winbar #49

DrKGD opened this issue Aug 11, 2022 · 4 comments · Fixed by #157

Comments

@DrKGD
Copy link

DrKGD commented Aug 11, 2022

Any winbar configuration made through heirline throws error E36: Not enough room on any second wilder prompt(s).

E5555: API call: Vim(append):Error executing lua callback: vim/_meta.lua:0: Vim:E36: Not enough room
stack traceback:
        [C]: in function 'nvim_set_option_value'
        vim/_meta.lua: in function '_set'
        vim/_meta.lua: in function '__newindex'
       ...te/pack/packer/start/heirline.nvim/lua/heirline/init.lua:28: in function <...te/pack/packer/start/heirline.nvim/lua/heirline/init.lua:27>

Any manual, global configuration, however, does not trigger aforementioned error.

-- Any statusline configuration, no winbar configuration
require('heirline').setup( ...  , nil )

vim.opt.winbar='%f'
-- or set winbar=%f

MRE (with packer)

-- Basic wilder configuration
use { "gelguy/wilder.nvim",
	event = 'CmdlineEnter',  -- Lazy loading on CmdlineEnter 
	config = function()
		local w = require('wilder')
		w.setup({modes = { '/', '?', ':'}})
	end }

use { "rebelot/heirline.nvim",
	config = function()
		require('heirline').setup({}, { provider = 'test'})
	end },
@DrKGD
Copy link
Author

DrKGD commented Aug 11, 2022

I suppose wilder creates a new buffer, along the lines of Wilder Popup %d and its buftype is nofile (from wilder vim_api.vim)

...
let l:buf = bufadd('[Wilder Popup ' . s:index . ']')
call bufload(l:buf)
call setbufvar(l:buf, '&buftype', 'nofile')
...

Thus I tried ignoring all nofile buffers in the winbar with no success

local bar = {
	condition = function()
		return not require('heirline.conditions').buffer_matches({
			buftype = { "nofile" },
		})
	end,

	provider = '%f'
}

require('heirline').setup({}, bar)

Am I missing something here?

@rebelot
Copy link
Owner

rebelot commented Aug 11, 2022

are you on latest nightly? neovim/neovim#19458 introduced several bugs when using local winbar. Please see #47 (comment) for a temporary fix

@DrKGD
Copy link
Author

DrKGD commented Aug 11, 2022

Damn, totally missed that ... thanks for the quick fix!

@rebelot
Copy link
Owner

rebelot commented Aug 11, 2022

related neovim/neovim#19464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants