refactor: rename oil to canola across entire codebase
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.
This commit is contained in:
parent
67ad0632a6
commit
e6b42168c9
70 changed files with 1571 additions and 1555 deletions
|
|
@ -1,13 +1,13 @@
|
|||
local cache = require('oil.cache')
|
||||
local test_adapter = require('oil.adapters.test')
|
||||
local util = require('oil.util')
|
||||
local cache = require('canola.cache')
|
||||
local test_adapter = require('canola.adapters.test')
|
||||
local util = require('canola.util')
|
||||
local M = {}
|
||||
|
||||
M.reset_editor = function()
|
||||
require('oil').setup({
|
||||
require('canola').setup({
|
||||
columms = {},
|
||||
adapters = {
|
||||
['oil-test://'] = 'test',
|
||||
['canola-test://'] = 'test',
|
||||
},
|
||||
prompt_save_on_select_new_entry = false,
|
||||
})
|
||||
|
|
@ -53,8 +53,8 @@ M.await_throwiferr = function(fn, nargs, ...)
|
|||
return throwiferr(M.await(fn, nargs, ...))
|
||||
end
|
||||
|
||||
M.oil_open = function(...)
|
||||
M.await(require('oil').open, 3, ...)
|
||||
M.canola_open = function(...)
|
||||
M.await(require('canola').open, 3, ...)
|
||||
end
|
||||
|
||||
M.wait_for_autocmd = function(autocmd)
|
||||
|
|
@ -81,7 +81,7 @@ M.wait_for_autocmd = function(autocmd)
|
|||
end
|
||||
end
|
||||
|
||||
M.wait_oil_ready = function()
|
||||
M.wait_canola_ready = function()
|
||||
local ready = false
|
||||
util.run_after_load(
|
||||
0,
|
||||
|
|
@ -93,7 +93,7 @@ M.wait_oil_ready = function()
|
|||
return ready
|
||||
end, 10)
|
||||
if not ready then
|
||||
error('wait_oil_ready timed out')
|
||||
error('wait_canola_ready timed out')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -113,34 +113,34 @@ M.feedkeys = function(actions, timestep)
|
|||
end
|
||||
|
||||
M.actions = {
|
||||
---Open oil and wait for it to finish rendering
|
||||
---Open canola and wait for it to finish rendering
|
||||
---@param args string[]
|
||||
open = function(args)
|
||||
vim.schedule(function()
|
||||
vim.cmd.Oil({ args = args })
|
||||
if vim.b.oil_ready then
|
||||
vim.cmd.Canola({ args = args })
|
||||
if vim.b.canola_ready then
|
||||
vim.api.nvim_exec_autocmds('User', {
|
||||
pattern = 'OilEnter',
|
||||
pattern = 'CanolaEnter',
|
||||
modeline = false,
|
||||
data = { buf = vim.api.nvim_get_current_buf() },
|
||||
})
|
||||
end
|
||||
end)
|
||||
M.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
M.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
end,
|
||||
|
||||
---Save all changes and wait for operation to complete
|
||||
save = function()
|
||||
vim.schedule_wrap(require('oil').save)({ confirm = false })
|
||||
M.wait_for_autocmd({ 'User', pattern = 'OilMutationComplete' })
|
||||
vim.schedule_wrap(require('canola').save)({ confirm = false })
|
||||
M.wait_for_autocmd({ 'User', pattern = 'CanolaMutationComplete' })
|
||||
end,
|
||||
|
||||
---@param bufnr? integer
|
||||
reload = function(bufnr)
|
||||
M.await(require('oil.view').render_buffer_async, 3, bufnr or 0)
|
||||
M.await(require('canola.view').render_buffer_async, 3, bufnr or 0)
|
||||
end,
|
||||
|
||||
---Move cursor to a file or directory in an oil buffer
|
||||
---Move cursor to a file or directory in an canola buffer
|
||||
---@param filename string
|
||||
focus = function(filename)
|
||||
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, true)
|
||||
|
|
@ -155,13 +155,13 @@ M.actions = {
|
|||
end,
|
||||
}
|
||||
|
||||
---Get the raw list of filenames from an unmodified oil buffer
|
||||
---Get the raw list of filenames from an unmodified canola buffer
|
||||
---@param bufnr? integer
|
||||
---@return string[]
|
||||
M.parse_entries = function(bufnr)
|
||||
bufnr = bufnr or 0
|
||||
if vim.bo[bufnr].modified then
|
||||
error("parse_entries doesn't work on a modified oil buffer")
|
||||
error("parse_entries doesn't work on a modified canola buffer")
|
||||
end
|
||||
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, true)
|
||||
return vim.tbl_map(function(line)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue