fix make lua to accept multiple targets

This commit is contained in:
2025-10-30 02:00:10 -03:00
parent 33b2570b4e
commit 92b3bd1af3

View File

@@ -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