Better reload logic
This commit is contained in:
parent
84669de981
commit
c0f5d2dfeb
@ -1,4 +1,4 @@
|
||||
local config = require('config')
|
||||
local config = require('argonaut.config')
|
||||
|
||||
local function setup(opts, filetypes)
|
||||
config.set_filetype_opts(opts, filetypes)
|
@ -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, {})
|
||||
|
Loading…
Reference in New Issue
Block a user