CHORE: Bug fixed c and cpp files and fixed their templates. Bug #3 is

also done
This commit is contained in:
2026-10-23 09:30:37 -04:00
parent 1c4a61ce7f
commit 4bf705df03
5 changed files with 76 additions and 44 deletions
+7 -2
View File
@@ -20,19 +20,24 @@ function M.create_project(opts)
local cfg = vim.tbl_deep_extend("force", {}, configs, configs, opts or {})
local root = join(vim.fn.expand(cfg.workspace_root), cfg.cpp.root, pname)
local bin = action_utils.create(cfg.cpp, pname, root)
utils.init_git(root, "c")
local build_cmd = "cd " .. root .. " && cmake -S . -B build"
local _ = vim.system({ "sh", "-c", build_cmd }):wait()
utils.init_git(root, "cpp")
vim.cmd.edit(vim.fn.fnameescape(bin))
end)
end
---@param opts VernCPPConfig
function M.create_file(opts)
vim.ui.input({ prompt = "Enter type (c/h): " }, function(ft)
ft = ft and vim.trim(ft)
if not ft or ft == "" then
return
end
local configs = require("vern.configs.c")
local configs = require("vern.configs.cpp")
---@type VernCPPConfig
local cfg = vim.tbl_deep_extend("force", {}, configs, opts or {})
vim.ui.input({ prompt = "Enter file name: " }, function(fname)