Fix so that oil can change buffers in the oil window, but you cannot change to another buffer inside the oil window.

This commit is contained in:
Martin Larsson 2024-05-26 15:27:27 +02:00
parent 2ba73eb10e
commit 9fc2ef3bb0
2 changed files with 31 additions and 16 deletions

View file

@ -8,4 +8,18 @@ function M.add_keymaps(maps)
end
end
function M.get_bufnr_for_filetype(filetype)
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.bo[buf].filetype == filetype then
return buf
end
end
return nil
end
function M.is_buf_filetype(bufnr, filetype)
return vim.bo[bufnr].filetype == filetype
end
return M