fix: set buftype before BufEnter fires on oil buffers (#10)
Problem: oil sets buftype='acwrite' inside view.initialize(), which runs in an async finish() callback after adapter.normalize_url(). BufEnter fires before finish() completes, so user autocmds that check buftype on oil buffers see an empty string instead of 'acwrite'. Solution: set buftype='acwrite' early in load_oil_buffer() alongside the existing early filetype='oil' assignment, before the async gap. The redundant set in view.initialize() is harmless (idempotent). Closes: stevearc/oil.nvim#710
This commit is contained in:
parent
034dce7f78
commit
01b860ed5c
1 changed files with 1 additions and 0 deletions
|
|
@ -1082,6 +1082,7 @@ M.load_oil_buffer = function(bufnr)
|
|||
-- (e.g. ssh) because it will set up the filetype keybinds at the *beginning* of the loading
|
||||
-- process.
|
||||
vim.bo[bufnr].filetype = "oil"
|
||||
vim.bo[bufnr].buftype = "acwrite"
|
||||
keymap_util.set_keymaps(config.keymaps, bufnr)
|
||||
end
|
||||
loading.set_loading(bufnr, true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue