fix make lua to accept multiple targets
This commit is contained in:
@@ -3,13 +3,14 @@ local M = {}
|
|||||||
local float_term = require("util.float").float_terminal
|
local float_term = require("util.float").float_terminal
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("Make", function(opts)
|
vim.api.nvim_create_user_command("Make", function(opts)
|
||||||
local t = opts.args
|
if opts.args == "" then
|
||||||
if t == "" then print("Usage: :Make <target>"); return end
|
print("Usage: :Make <targets>")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local args = vim.split(opts.args, "%s+")
|
||||||
float_term(
|
float_term(
|
||||||
{ "make", t},
|
vim.list_extend({ "make" }, args),
|
||||||
{ height_ratio = 0.8, width_ratio = 0.8, border = "single" }
|
{ height_ratio = 0.8, width_ratio = 0.8, border = "single" }
|
||||||
)
|
)
|
||||||
end, { nargs = 1 })
|
end, { nargs = "*" })
|
||||||
|
|
||||||
return M
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user