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:
+13
-2
@@ -8,6 +8,9 @@ function M.dump(path, content)
|
||||
file:close()
|
||||
end
|
||||
|
||||
---@param str string String to replace
|
||||
---@param ctx table<string, string> Replacment characters
|
||||
---@return string
|
||||
function M.fmt(str, ctx)
|
||||
return (str:gsub("{([^}]+)}", ctx))
|
||||
end
|
||||
@@ -70,8 +73,9 @@ end
|
||||
|
||||
---@param cmd table
|
||||
---@param opts VernTerminalConfig
|
||||
---@param scratch boolean
|
||||
---@return integer, integer?
|
||||
function M.term(cmd, opts)
|
||||
function M.term(cmd, opts, scratch)
|
||||
opts = opts or {}
|
||||
local buf, win
|
||||
if opts.mode.type == "float" then
|
||||
@@ -109,6 +113,9 @@ function M.term(cmd, opts)
|
||||
style = "minimal",
|
||||
border = opts.mode.win.float.border.enabled and opts.mode.win.float.border.type or nil,
|
||||
})
|
||||
if scratch then
|
||||
return buf, win
|
||||
end
|
||||
end
|
||||
if opts.mode.type == "split" then
|
||||
if opts.mode.win.split.direction == "vertical" then
|
||||
@@ -128,8 +135,12 @@ function M.term(cmd, opts)
|
||||
win = vim.api.nvim_get_current_win()
|
||||
|
||||
vim.api.nvim_win_set_buf(0, buf)
|
||||
if scratch then
|
||||
return buf, win
|
||||
end
|
||||
end
|
||||
vim.fn.jobstart(table.concat(cmd, "/"), { term = true })
|
||||
local full_cmd = type(cmd) == "table" and table.concat(cmd, " ") or cmd
|
||||
vim.fn.jobstart(full_cmd, { term = true })
|
||||
vim.api.nvim_buf_set_keymap(
|
||||
buf,
|
||||
"n",
|
||||
|
||||
Reference in New Issue
Block a user