docs: removed warning from c files about early build issues

This commit is contained in:
DarthMooMancer
2025-05-07 10:45:21 -04:00
parent bb9efdbd8a
commit cac1fdb02c
4 changed files with 16 additions and 36 deletions
-5
View File
@@ -1,10 +1,5 @@
### C Setup for Polydev 🛠️
#### Key Notes ⚠️
> **Important**: The first time you build a project, it might throw an error. This is expected behavior. Simply rerun the build, and if errors persist, it may be an issue with your project setup rather than the plugin.
---
#### Keybinds 🎮
You can customize keybinds for your C projects with Polydev.
-5
View File
@@ -1,10 +1,5 @@
### C Setup for Polydev 🛠️
#### Key Notes ⚠️
> **Important**: The first time you build a project, it might throw an error. This is expected behavior. Simply rerun the build, and if errors persist, it may be an issue with your project setup rather than the plugin.
---
#### Keybinds 🎮
You can customize keybinds for your C projects with Polydev.
+9 -15
View File
@@ -6,27 +6,24 @@ local Layout = require("nui.layout")
local event = require("nui.utils.autocmd").event
local Path = require("plenary.path")
---@type table
local M = {}
---@type table
M.loaded_languages = {}
---@param lang string
---@param opts table?
---@return boolean
---@type table
M.keybinds = {}
-- Load language opts based on filetype
function M.load_language_module(lang, opts)
if M.loaded_languages[lang] then return true end
local ok, lang_module = pcall(require, "Polydev.languages." .. lang)
if ok and lang_module.setup then
local lang_opts = opts and opts[lang] or {}
lang_module.setup(lang_opts)
M.loaded_languages[lang] = lang_module
local ok, mod = pcall(require, "Polydev.languages." .. lang)
if not ok or type(mod.setup) ~= "function" then return false end
mod.setup(opts and opts[lang] or {})
M.loaded_languages[lang] = mod
return true
end
return false
end
-- Get entries in a given path
local function get_entries(path)
@@ -392,9 +389,6 @@ local function open_filtered_table()
render()
end
---@type table
M.keybinds = {}
local function setupKeybinds(opts)
M.opts = {}
+5 -9
View File
@@ -7,9 +7,6 @@ local M = {}
---@type table
M.opts = {}
---@type table
local presets_opts = {}
---@param opts table
function M.setup(opts)
M.opts = vim.tbl_deep_extend("force", {}, require("Polydev.configs").get("terminal"), opts or {})
@@ -29,15 +26,14 @@ function M.write_file(path, content)
file:write(content)
file:close()
vim.cmd("edit " .. path)
print(path .. " created successfully!")
end
---@param cmd string
---@return boolean, table
---@return boolean?, table?, nil?
function M.open_float_terminal(cmd)
if presets.getPresets(M.opts.presets) ~= nil then
local presets_opts = {}
if presets.getPresets(M.opts.presets) == nil then return nil end
presets_opts = presets.getPresets(M.opts.presets)
end
local ui = vim.api.nvim_list_uis()[1]
local width = math.max(1, math.floor(ui.width * 0.9) - presets_opts.left_padding - presets_opts.right_padding)
@@ -59,9 +55,9 @@ function M.open_float_terminal(cmd)
vim.api.nvim_set_option_value("winhighlight", "Normal:Pmenu,FloatBorder:Pmenu", { win = win })
vim.api.nvim_set_option_value("cursorline", true, { win = win })
vim.api.nvim_set_option_value("scrolloff", 5, { win = win })
if(M.opts.number == true) then
if(M.opts.number) then
vim.api.nvim_set_option_value("number", true, { win = win })
if(M.opts.relativenumber == true) then
if(M.opts.relativenumber) then
vim.api.nvim_set_option_value("relativenumber", true, { win = win })
end
end