diff options
author | Daniil Rozanov <daniilrozzanov@gmail.com> | 2024-04-26 02:09:30 +0300 |
---|---|---|
committer | Daniil Rozanov <daniilrozzanov@gmail.com> | 2024-04-26 02:09:30 +0300 |
commit | 93945a96daad5db8f91b07d1aef65b3ec6f758fb (patch) | |
tree | 92b061bfffcf58515bb4c04ed448364262d67341 /lua/cmake/actions.lua | |
parent | 8d05fcaaeb1442c709f148ff934d92900743f051 (diff) |
feat: autocommands to regenerate and reset project
One autocommand generates project after saving CMakeLists.txt, and other sets up all project after saving variants
Diffstat (limited to 'lua/cmake/actions.lua')
-rw-r--r-- | lua/cmake/actions.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/cmake/actions.lua b/lua/cmake/actions.lua index 3c09d93..4008f7c 100644 --- a/lua/cmake/actions.lua +++ b/lua/cmake/actions.lua @@ -5,6 +5,8 @@ local utils = require("cmake.utils") local constants = require("cmake.constants") local Path = require("plenary.path") +local uv = vim.uv or vim.loop + local M = {} local default_generate_exe_opts = { @@ -92,7 +94,7 @@ M.run_tagret = function(opts) M.run_tagret_select(opts) else local command = { - cmd = Path:new(pr.current_directory(), _curr_exe_cmd.path):make_relative(vim.loop.cwd()), + cmd = Path:new(pr.current_directory(), _curr_exe_cmd.path):make_relative(uv.cwd()), } t.target_execute(command) end @@ -113,7 +115,7 @@ M.run_tagret_select = function(opts) end pr.set_current_executable_target(idx) local command = { - cmd = Path:new(pr.current_directory(), choice.path):make_relative(vim.loop.cwd()), + cmd = Path:new(pr.current_directory(), choice.path):make_relative(uv.cwd()), } t.target_execute(command) end) |