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,8 +1,8 @@
|
|||
local TmpDir = require('spec.tmpdir')
|
||||
local actions = require('oil.actions')
|
||||
local oil = require('oil')
|
||||
local actions = require('canola.actions')
|
||||
local canola = require('canola')
|
||||
local test_util = require('spec.test_util')
|
||||
local view = require('oil.view')
|
||||
local view = require('canola.view')
|
||||
|
||||
describe('regression tests', function()
|
||||
local tmpdir
|
||||
|
|
@ -21,29 +21,29 @@ describe('regression tests', function()
|
|||
vim.cmd.edit({ args = { 'README.md' } })
|
||||
vim.cmd.vsplit()
|
||||
vim.cmd.edit({ args = { '%:p:h' } })
|
||||
assert.equals('oil', vim.bo.filetype)
|
||||
assert.equals('canola', vim.bo.filetype)
|
||||
vim.cmd.wincmd({ args = { 'p' } })
|
||||
assert.equals('markdown', vim.bo.filetype)
|
||||
vim.cmd.edit({ args = { '%:p:h' } })
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
assert.equals('oil', vim.bo.filetype)
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
assert.equals('canola', vim.bo.filetype)
|
||||
end)
|
||||
|
||||
it('places the cursor on correct entry when opening on file', function()
|
||||
vim.cmd.edit({ args = { '.' } })
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
local entry = oil.get_cursor_entry()
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
local entry = canola.get_cursor_entry()
|
||||
assert.not_nil(entry)
|
||||
assert.not_equals('README.md', entry and entry.name)
|
||||
vim.cmd.edit({ args = { 'README.md' } })
|
||||
view.delete_hidden_buffers()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
entry = oil.get_cursor_entry()
|
||||
canola.open()
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
entry = canola.get_cursor_entry()
|
||||
assert.equals('README.md', entry and entry.name)
|
||||
end)
|
||||
|
||||
it("doesn't close floating windows oil didn't open itself", function()
|
||||
it("doesn't close floating windows canola didn't open itself", function()
|
||||
local winid = vim.api.nvim_open_win(vim.fn.bufadd('README.md'), true, {
|
||||
relative = 'editor',
|
||||
row = 1,
|
||||
|
|
@ -51,21 +51,21 @@ describe('regression tests', function()
|
|||
width = 100,
|
||||
height = 100,
|
||||
})
|
||||
oil.open()
|
||||
canola.open()
|
||||
vim.wait(10)
|
||||
oil.close()
|
||||
canola.close()
|
||||
vim.wait(10)
|
||||
assert.equals(winid, vim.api.nvim_get_current_win())
|
||||
end)
|
||||
|
||||
it("doesn't close splits on oil.close", function()
|
||||
it("doesn't close splits on canola.close", function()
|
||||
vim.cmd.edit({ args = { 'README.md' } })
|
||||
vim.cmd.vsplit()
|
||||
local winid = vim.api.nvim_get_current_win()
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
oil.open()
|
||||
canola.open()
|
||||
vim.wait(10)
|
||||
oil.close()
|
||||
canola.close()
|
||||
vim.wait(10)
|
||||
assert.equals(2, #vim.api.nvim_tabpage_list_wins(0))
|
||||
assert.equals(winid, vim.api.nvim_get_current_win())
|
||||
|
|
@ -73,24 +73,24 @@ describe('regression tests', function()
|
|||
end)
|
||||
|
||||
it('Returns to empty buffer on close', function()
|
||||
oil.open()
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
oil.close()
|
||||
assert.not_equals('oil', vim.bo.filetype)
|
||||
canola.open()
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
canola.close()
|
||||
assert.not_equals('canola', vim.bo.filetype)
|
||||
assert.equals('', vim.api.nvim_buf_get_name(0))
|
||||
end)
|
||||
|
||||
it('All buffers set nomodified after save', function()
|
||||
tmpdir:create({ 'a.txt' })
|
||||
vim.cmd.edit({ args = { 'oil://' .. vim.fn.fnamemodify(tmpdir.path, ':p') } })
|
||||
vim.cmd.edit({ args = { 'canola://' .. vim.fn.fnamemodify(tmpdir.path, ':p') } })
|
||||
local first_dir = vim.api.nvim_get_current_buf()
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
test_util.feedkeys({ 'dd', 'itest/<esc>', '<CR>' }, 10)
|
||||
vim.wait(1000, function()
|
||||
return vim.bo.modifiable
|
||||
end, 10)
|
||||
test_util.feedkeys({ 'p' }, 10)
|
||||
oil.save({ confirm = false })
|
||||
canola.save({ confirm = false })
|
||||
vim.wait(1000, function()
|
||||
return vim.bo.modifiable
|
||||
end, 10)
|
||||
|
|
@ -102,11 +102,11 @@ describe('regression tests', function()
|
|||
|
||||
it("refreshing buffer doesn't lose track of it", function()
|
||||
vim.cmd.edit({ args = { '.' } })
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
vim.cmd.edit({ bang = true })
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
assert.are.same({ bufnr }, require('oil.view').get_all_buffers())
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
assert.are.same({ bufnr }, require('canola.view').get_all_buffers())
|
||||
end)
|
||||
|
||||
it('can copy a file multiple times', function()
|
||||
|
|
@ -126,8 +126,8 @@ describe('regression tests', function()
|
|||
|
||||
it('can open files from floating window', function()
|
||||
tmpdir:create({ 'a.txt' })
|
||||
oil.open_float(tmpdir.path)
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'OilEnter' })
|
||||
canola.open_float(tmpdir.path)
|
||||
test_util.wait_for_autocmd({ 'User', pattern = 'CanolaEnter' })
|
||||
actions.select.callback()
|
||||
vim.wait(1000, function()
|
||||
return vim.fn.expand('%:t') == 'a.txt'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue