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)
|
local function setup(opts, filetypes)
|
||||||
config.set_filetype_opts(opts, filetypes)
|
config.set_filetype_opts(opts, filetypes)
|
@ -1,14 +1,15 @@
|
|||||||
if not vim.g.argonaut then
|
if not vim.g.argonaut then
|
||||||
local argonaut = require('argonaut')
|
|
||||||
|
|
||||||
local function argonaut_reload()
|
local function argonaut_reload()
|
||||||
package.loaded.argonaut = nil
|
for name, _ in pairs(package.loaded) do
|
||||||
argonaut = require('argonaut')
|
if vim.startswith(name, 'argonaut') then
|
||||||
|
package.loaded[name] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function argonaut_reflow()
|
local function argonaut_reflow()
|
||||||
argonaut_reload()
|
argonaut_reload()
|
||||||
argonaut.reflow()
|
require('argonaut').reflow()
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_user_command('ArgonautReload', argonaut_reload, {})
|
vim.api.nvim_create_user_command('ArgonautReload', argonaut_reload, {})
|
||||||
|
Loading…
Reference in New Issue
Block a user