CHORE: Fixed bug #4 by looping dirs and creating directories before
other loops in creation. LANG: Added CPP and bugfixed c to use c code and not python
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
local actions = require("vern.actions.python")
|
||||
local config = require("vern.configs.python")
|
||||
local actions = require("vern.actions.c")
|
||||
local config = require("vern.configs.c")
|
||||
|
||||
---@param bufnr integer Buffer to activate on : defaults to 0
|
||||
---@param user_opts? VernPythonConfig
|
||||
---@param user_opts? VernCConfig
|
||||
return function(bufnr, user_opts)
|
||||
---@type VernPythonConfig
|
||||
---@type VernCConfig
|
||||
local opts = vim.tbl_deep_extend("force", {}, config, user_opts or {})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "CRun", function()
|
||||
if type(actions.run) == "function" then
|
||||
@@ -12,7 +12,7 @@ return function(bufnr, user_opts)
|
||||
end
|
||||
end, { desc = "Run c project" })
|
||||
|
||||
for key, def in pairs(opts.python.keybinds or {}) do
|
||||
for key, def in pairs(opts.c.keybinds or {}) do
|
||||
if type(def.action) == "function" then
|
||||
vim.keymap.set("n", key, function()
|
||||
def.action(opts)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
local actions = require("vern.actions.cpp")
|
||||
local config = require("vern.configs.cpp")
|
||||
|
||||
---@param bufnr integer Buffer to activate on : defaults to 0
|
||||
---@param user_opts? VernCPPConfig
|
||||
return function(bufnr, user_opts)
|
||||
---@type VernCPPConfig
|
||||
local opts = vim.tbl_deep_extend("force", {}, config, user_opts or {})
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "CPPRun", function()
|
||||
if type(actions.run) == "function" then
|
||||
actions.run(opts)
|
||||
end
|
||||
end, { desc = "Run cpp project" })
|
||||
|
||||
for key, def in pairs(opts.cpp.keybinds or {}) do
|
||||
if type(def.action) == "function" then
|
||||
vim.keymap.set("n", key, function()
|
||||
def.action(opts)
|
||||
end, {
|
||||
buffer = bufnr,
|
||||
silent = true,
|
||||
desc = def.desc,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user