Problem: the codebase still used the upstream \`oil\` naming everywhere — URL schemes, the \`:Oil\` command, highlight groups, user events, module paths, filetypes, buffer/window variables, LuaCATS type annotations, vimdoc help tags, syntax groups, and internal identifiers. Solution: mechanical rename of every reference. URL schemes now use \`canola://\` (plus \`canola-ssh://\`, \`canola-s3://\`, \`canola-sss://\`, \`canola-trash://\`, \`canola-test://\`). The \`:Canola\` command replaces \`:Oil\`. All highlight groups, user events, augroups, namespaces, filetypes, require paths, type annotations, help tags, and identifiers follow suit. The \`upstream\` remote to \`stevearc/oil.nvim\` has been removed and the \`vim.g.oil\` deprecation shim dropped.
27 lines
823 B
Lua
27 lines
823 B
Lua
local config = require('canola.config')
|
|
|
|
describe('config', function()
|
|
after_each(function()
|
|
vim.g.canola = nil
|
|
end)
|
|
|
|
it('falls back to vim.g.canola when setup() is called with no args', function()
|
|
vim.g.canola = { delete_to_trash = true, cleanup_delay_ms = 5000 }
|
|
config.setup()
|
|
assert.is_true(config.delete_to_trash)
|
|
assert.equals(5000, config.cleanup_delay_ms)
|
|
end)
|
|
|
|
it('uses defaults when neither opts nor vim.g.canola is set', function()
|
|
vim.g.canola = nil
|
|
config.setup()
|
|
assert.is_false(config.delete_to_trash)
|
|
assert.equals(2000, config.cleanup_delay_ms)
|
|
end)
|
|
|
|
it('prefers explicit opts over vim.g.canola', function()
|
|
vim.g.canola = { delete_to_trash = true }
|
|
config.setup({ delete_to_trash = false })
|
|
assert.is_false(config.delete_to_trash)
|
|
end)
|
|
end)
|