This commit is contained in:
Andrew Haynes
2026-03-30 00:04:53 -04:00
parent 2ca6c62cd8
commit 22215cccda
+4 -3
View File
@@ -6,7 +6,7 @@ function M.setup(opts)
end end
function M.exists(path) function M.exists(path)
return (io.open(path,"r") ~= nil) return (io.open(path, "r") ~= nil)
end end
---@return string ---@return string
@@ -26,7 +26,7 @@ end
---@param content string ---@param content string
function M.write_file(path_segments, content) function M.write_file(path_segments, content)
local path = table.concat(path_segments, "/") local path = table.concat(path_segments, "/")
local file = assert(io.open(path, "w"), "Error creating file: " .. path) local file = assert(io.open(path, "w"), "Fucking dumbass code: Error creating file: " .. path)
file:write(content) file:write(content)
file:close() file:close()
vim.cmd("edit " .. path) vim.cmd("edit " .. path)
@@ -75,7 +75,8 @@ function M.terminal(cmd)
style = "minimal", style = "minimal",
border = M.opts.border.enabled and M.opts.border.type, border = M.opts.border.enabled and M.opts.border.type,
}) })
vim.api.nvim_set_option_value("winhighlight", "Normal:PolydevNormal,FloatBorder:PolydevBorder", { win = win }) vim.api.nvim_set_option_value("winhighlight", "Normal:PolydevNormal,FloatBorder:PolydevBorder",
{ win = win })
vim.fn.jobstart(table.concat(cmd, "/"), { term = true }) vim.fn.jobstart(table.concat(cmd, "/"), { term = true })
vim.api.nvim_buf_set_keymap(buf, "n", "<ESC>", "i<C-\\><C-n>:q<CR>", { noremap = true, silent = true }) vim.api.nvim_buf_set_keymap(buf, "n", "<ESC>", "i<C-\\><C-n>:q<CR>", { noremap = true, silent = true })
return buf, win return buf, win