feat: API to automatically open preview window after opening oil (#339)

This commit is contained in:
Steven Arcangeli 2025-01-24 15:09:36 -08:00
parent 52f1683c76
commit 57528bf9c5
6 changed files with 135 additions and 31 deletions

View file

@ -1,6 +1,7 @@
require("plenary.async").tests.add_to_env()
local cache = require("oil.cache")
local test_adapter = require("oil.adapters.test")
local util = require("oil.util")
local M = {}
M.reset_editor = function()
@ -53,6 +54,10 @@ M.wait_for_autocmd = a.wrap(function(autocmd, cb)
vim.api.nvim_create_autocmd(autocmd, opts)
end, 2)
M.wait_oil_ready = a.wrap(function(cb)
util.run_after_load(0, vim.schedule_wrap(cb))
end, 1)
---@param actions string[]
---@param timestep integer
M.feedkeys = function(actions, timestep)