fix(init): load oil buffer when BufAdd hijack fires under trouble/bqf
Problem: `BufAdd` handler renames a directory buffer to its `oil://` URL and relies on the resulting `BufReadCmd` to load it. Plugins like trouble.nvim that intercept quickfix opening suppress nested autocmds, so `BufReadCmd` never fires and the buffer is left blank. Solution: call `load_oil_buffer` directly after a successful hijack, matching the startup loop which already does this. `load_oil_buffer` guards against double-loading, so normal-path callers where `BufReadCmd` does fire are unaffected.
This commit is contained in:
parent
499bae1975
commit
c3ef048144
1 changed files with 3 additions and 1 deletions
|
|
@ -1646,7 +1646,9 @@ M.setup = function(opts)
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
nested = true,
|
nested = true,
|
||||||
callback = function(params)
|
callback = function(params)
|
||||||
maybe_hijack_directory_buffer(params.buf)
|
if maybe_hijack_directory_buffer(params.buf) and vim.v.vim_did_enter == 1 then
|
||||||
|
M.load_oil_buffer(params.buf)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue