fix(plugin): now commands register properly
This commit is contained in:
parent
0fb1c01806
commit
ada9e1461d
2 changed files with 8 additions and 9 deletions
|
|
@ -55,19 +55,19 @@ gopher.test = {
|
||||||
}
|
}
|
||||||
|
|
||||||
gopher.get = function(...)
|
gopher.get = function(...)
|
||||||
gocmd("get", { ... })
|
gocmd("get", ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
gopher.mod = function(...)
|
gopher.mod = function(...)
|
||||||
gocmd("mod", { ... })
|
gocmd("mod", ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
gopher.generate = function(...)
|
gopher.generate = function(...)
|
||||||
gocmd("generate", { ... })
|
gocmd("generate", ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
gopher.work = function(...)
|
gopher.work = function(...)
|
||||||
gocmd("work", { ... })
|
gocmd("work", ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
return gopher
|
return gopher
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ if c.setup_commands then
|
||||||
|
|
||||||
-- :Go
|
-- :Go
|
||||||
vim.api.nvim_create_user_command("GoMod", function(opts)
|
vim.api.nvim_create_user_command("GoMod", function(opts)
|
||||||
require("gopher").mod(unpack(opts.fargs))
|
require("gopher").mod(opts.fargs)
|
||||||
end, { nargs = "*" })
|
end, { nargs = "*" })
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("GoGet", function(opts)
|
vim.api.nvim_create_user_command("GoGet", function(opts)
|
||||||
|
|
@ -67,11 +67,10 @@ if c.setup_commands then
|
||||||
end, { nargs = "*" })
|
end, { nargs = "*" })
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("GoWork", function(opts)
|
vim.api.nvim_create_user_command("GoWork", function(opts)
|
||||||
vim.print(opts)
|
require("gopher").get(opts.fargs)
|
||||||
require("gopher").get(unpack(opts.fargs))
|
|
||||||
end, { nargs = "*" })
|
end, { nargs = "*" })
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("GoGenerate", function(opts)
|
vim.api.nvim_create_user_command("GoGenerate", function(opts)
|
||||||
require("gopher").generate(unpack(opts.fargs))
|
require("gopher").generate(opts.fargs or "")
|
||||||
end, { nargs = 1 })
|
end, { nargs = "?" })
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue