Update namespacing
This commit is contained in:
parent
9ae1248373
commit
4847e4f918
@ -1,29 +1,30 @@
|
|||||||
if not vim.g.guid then
|
if not vim.g.guid then
|
||||||
local guid = require('guid')
|
local function guid_reload()
|
||||||
|
for name, _ in pairs(package.loaded) do
|
||||||
local function reload()
|
if vim.startswith(name, 'guid') then
|
||||||
package.loaded.guid = nil
|
package.loaded[name] = nil
|
||||||
guid = require('guid')
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function insert(ctx)
|
local function guid_insert(ctx)
|
||||||
guid.guid_insert(ctx.args)
|
require('guid').guid_insert(ctx.args)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function format(ctx)
|
local function guid_format(ctx)
|
||||||
guid.guid_format(ctx.args)
|
require('guid').guid_format(ctx.args)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function object()
|
local function guid_object()
|
||||||
guid.guid_object()
|
require('guid').guid_object()
|
||||||
end
|
end
|
||||||
|
|
||||||
math.randomseed(os.time())
|
math.randomseed(os.time())
|
||||||
|
|
||||||
vim.api.nvim_create_user_command('GuidFormat', format, {nargs = '?'})
|
vim.api.nvim_create_user_command('GuidFormat', guid_format, {nargs = '?'})
|
||||||
vim.api.nvim_create_user_command('GuidInsert', insert, {nargs = '?'})
|
vim.api.nvim_create_user_command('GuidInsert', guid_insert, {nargs = '?'})
|
||||||
vim.api.nvim_create_user_command('GuidObject', object, {})
|
vim.api.nvim_create_user_command('GuidObject', guid_object, {})
|
||||||
vim.api.nvim_create_user_command('GuidReload', reload, {})
|
vim.api.nvim_create_user_command('GuidReload', guid_reload, {})
|
||||||
|
|
||||||
vim.g.guid = true
|
vim.g.guid = true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user