From 93945a96daad5db8f91b07d1aef65b3ec6f758fb Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Fri, 26 Apr 2024 02:09:30 +0300 Subject: feat: autocommands to regenerate and reset project One autocommand generates project after saving CMakeLists.txt, and other sets up all project after saving variants --- lua/cmake/actions.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua/cmake/actions.lua') 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) -- cgit v1.2.3