2024-12-30 20:31:50 -08:00
|
|
|
if not vim.g.argonaut_loaded then
|
2023-01-28 19:20:14 -08:00
|
|
|
local function argonaut_reload()
|
2024-04-20 12:03:24 -07:00
|
|
|
for name, _ in pairs(package.loaded) do
|
|
|
|
if vim.startswith(name, 'argonaut') then
|
|
|
|
package.loaded[name] = nil
|
|
|
|
end
|
|
|
|
end
|
2023-01-28 19:20:14 -08:00
|
|
|
end
|
2022-12-30 11:09:28 -08:00
|
|
|
|
2025-01-19 15:35:54 -08:00
|
|
|
local function argonaut_inspect()
|
|
|
|
require('argonaut').inspect()
|
2025-01-18 20:36:32 -08:00
|
|
|
end
|
|
|
|
|
2025-01-19 17:04:20 -08:00
|
|
|
local function argonaut_object_inner()
|
|
|
|
argonaut_reload()
|
|
|
|
require('argonaut').object(true)
|
|
|
|
end
|
|
|
|
|
|
|
|
local function argonaut_object_outer()
|
|
|
|
argonaut_reload()
|
|
|
|
require('argonaut').object(false)
|
|
|
|
end
|
|
|
|
|
2023-01-28 19:20:14 -08:00
|
|
|
local function argonaut_reflow()
|
2025-01-19 15:35:54 -08:00
|
|
|
require('argonaut').reflow(false)
|
2023-01-28 19:20:14 -08:00
|
|
|
end
|
2022-12-30 15:10:22 -08:00
|
|
|
|
2025-01-19 15:35:54 -08:00
|
|
|
local function argonaut_toggle()
|
|
|
|
require('argonaut').reflow(true)
|
2025-01-18 18:24:01 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
vim.api.nvim_create_user_command('ArgonautInspect', argonaut_inspect, {})
|
2025-01-19 17:04:20 -08:00
|
|
|
vim.api.nvim_create_user_command('ArgonautObjectInner', argonaut_object_inner, {})
|
|
|
|
vim.api.nvim_create_user_command('ArgonautObjectOuter', argonaut_object_outer, {})
|
2025-01-19 15:35:54 -08:00
|
|
|
vim.api.nvim_create_user_command('ArgonautReflow', argonaut_reflow, {})
|
|
|
|
vim.api.nvim_create_user_command('ArgonautReload', argonaut_reload, {})
|
|
|
|
vim.api.nvim_create_user_command('ArgonautToggle', argonaut_toggle, {})
|
2023-01-28 19:20:14 -08:00
|
|
|
|
2024-12-30 20:31:50 -08:00
|
|
|
vim.g.argonaut_loaded = true
|
2022-12-30 10:40:23 -08:00
|
|
|
end
|