CHORE: Bug fixed c and cpp files and fixed their templates. Bug #3 is
also done
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user