1

Update generated nvim config

This commit is contained in:
2024-06-05 22:05:42 +02:00
parent 859ee3a2ba
commit 075fe5f587
1292 changed files with 152601 additions and 0 deletions

View File

@ -0,0 +1,22 @@
local session_dir = vim.loop.cwd() .. "/tests/dummy_data/"
require("persisted").setup({
save_dir = session_dir,
autoload = true,
autosave = true,
allowed_dirs = { vim.loop.cwd() },
})
describe("Autoloading", function()
it("autoloads a file with allowed_dirs config option present", function()
local co = coroutine.running()
vim.defer_fn(function()
coroutine.resume(co)
local content = vim.fn.getline(1, "$")
assert.equals("If you're reading this, I guess auto-loading works", content[1])
end, 1000)
coroutine.yield()
end)
end)

View File

@ -0,0 +1,47 @@
describe("Autoloading", function()
it("autoloads a file", function()
local co = coroutine.running()
vim.defer_fn(function()
coroutine.resume(co)
end, 2000)
local session_dir = vim.fn.getcwd() .. "/tests/dummy_data/"
require("persisted").setup({
save_dir = session_dir,
autoload = true,
autosave = true,
})
coroutine.yield()
local content = vim.fn.getline(1, "$")
assert.equals("If you're reading this, I guess auto-loading works", content[1])
end)
it("autoloads the a child directory of ignored_dirs exact", function()
local co = coroutine.running()
vim.defer_fn(function()
coroutine.resume(co)
end, 2000)
local fp_sep = vim.loop.os_uname().sysname:lower():match("windows") and "\\" or "/" -- \ for windows, mac and linux both use \
local session_dir = vim.fn.getcwd() .. "/test/dummy_data/"
require("persisted").setup({
save_dir = session_dir,
autoload = true,
autosave = true,
ignored_dirs = {
-- Setting the parent of our current to an ignored directory
{
string.format("%s%s..%s", vim.fn.getcwd(), fp_sep, fp_sep),
exact = true,
},
},
})
coroutine.yield()
local content = vim.fn.getline(1, "$")
assert.equals("If you're reading this, I guess auto-loading works", content[1])
end)
end)

View File

@ -0,0 +1,20 @@
local session_dir = vim.fn.getcwd() .. "/tests/dummy_data/"
require("persisted").setup({
save_dir = session_dir,
autoload = true,
ignored_dirs = { vim.fn.getcwd() },
})
describe("Autoloading", function()
it("is stopped if an ignored dir is present", function()
local co = coroutine.running()
vim.defer_fn(function()
coroutine.resume(co)
end, 1000)
coroutine.yield()
local content = vim.fn.getline(1, "$")
assert.equals(content[1], "")
end)
end)