1

Better reload logic

This commit is contained in:
Alex Yatskov 2024-04-20 12:03:24 -07:00
parent 84669de981
commit c0f5d2dfeb
3 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,4 @@
local config = require('config')
local config = require('argonaut.config')
local function setup(opts, filetypes)
config.set_filetype_opts(opts, filetypes)

View File

@ -1,14 +1,15 @@
if not vim.g.argonaut then
local argonaut = require('argonaut')
local function argonaut_reload()
package.loaded.argonaut = nil
argonaut = require('argonaut')
for name, _ in pairs(package.loaded) do
if vim.startswith(name, 'argonaut') then
package.loaded[name] = nil
end
end
end
local function argonaut_reflow()
argonaut_reload()
argonaut.reflow()
require('argonaut').reflow()
end
vim.api.nvim_create_user_command('ArgonautReload', argonaut_reload, {})