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

fix: support single buffer enabled without global #750

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions lua/ibl/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,23 @@ local clear_buffer = function(bufnr)
for _, fn in pairs(hooks.get(bufnr, hooks.type.CLEAR)) do
fn(bufnr)
end
global_buffer_state[bufnr] = nil
end

---@param config ibl.config.full
local setup = function(config)
M.initialized = true

if not config.enabled then
for bufnr, _ in pairs(global_buffer_state) do
clear_buffer(bufnr)
if not conf.get_config(bufnr).enabled then
clear_buffer(bufnr)
end
end
global_buffer_state = {}
inlay_hints.clear()
return
end

inlay_hints.setup()
highlights.setup()
autocmds.setup()
M.initialized = true
M.refresh_all()
end

Expand Down
Loading