fix: c/c++ had compile commands linked unnecassarily

This commit is contained in:
DarthMooMancer
2025-09-04 21:07:27 -04:00
parent 66ae61f2c9
commit 5765c8ea19
2 changed files with 75 additions and 78 deletions
+2 -2
View File
@@ -113,7 +113,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
]], project_name, project_name)) ]], project_name, project_name))
local gitignore = { "build/" } local gitignore = { "build/" }
utils.init_git(full_project_root, gitignore) utils.init_git(full_project_root, gitignore)
vim.fn.system(string.format("cd %s/build && cmake -S .. -B . && cmake --build . && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. && ln -sf compile_commands.json ../compile_commands.json", full_project_root)) vim.fn.system(string.format("cd %s/build && cmake -S .. -B . && cmake --build . && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..", full_project_root))
vim.cmd("edit " .. full_project_root .. "/src/main.c") vim.cmd("edit " .. full_project_root .. "/src/main.c")
end end
}, },
@@ -147,7 +147,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
local gitignore = { "build/" } local gitignore = { "build/" }
utils.init_git(full_project_root, gitignore) utils.init_git(full_project_root, gitignore)
vim.fn.system(string.format("cd %s/build && cmake -S .. -B . && cmake --build . && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. && ln -sf compile_commands.json ../compile_commands.json", full_project_root)) vim.fn.system(string.format("cd %s/build && cmake -S .. -B . && cmake --build . && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..", full_project_root))
vim.cmd("edit " .. full_project_root .. "/src/main.cpp") vim.cmd("edit " .. full_project_root .. "/src/main.cpp")
end end
}, },
+1 -4
View File
@@ -47,10 +47,7 @@ function M.terminal(cmd)
local opts = require("Polydev.presets").getPresets(M.opts.win.anchor) local opts = require("Polydev.presets").getPresets(M.opts.win.anchor)
local ui = vim.api.nvim_list_uis()[1] local ui = vim.api.nvim_list_uis()[1]
local width local width, height, row, col
local height
local row
local col
if opts ~= nil then if opts ~= nil then
width = math.max(1, math.floor(ui.width * 0.9) - opts.left - opts.right) width = math.max(1, math.floor(ui.width * 0.9) - opts.left - opts.right)