From f828dd8ff17686acf75faa3eca87842e83a75a94 Mon Sep 17 00:00:00 2001 From: harivansh-afk Date: Thu, 20 Nov 2025 14:49:52 -0500 Subject: [PATCH] fx --- lua/plugins/refactor.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lua/plugins/refactor.lua b/lua/plugins/refactor.lua index c6c9625..4a50054 100644 --- a/lua/plugins/refactor.lua +++ b/lua/plugins/refactor.lua @@ -19,17 +19,14 @@ return { vim.notify(string.format("Refactoring with model '%s'...", model), vim.log.levels.INFO) - -- Run refactor script asynchronously in the background - -- Using nohup to detach from nvim - continues running if nvim closes - local log_file = vim.fn.expand("~/.ai/refactor-nvim.log") + -- Run refactor script synchronously local cmd = { - "sh", "-c", - string.format("nohup bun %s '%s' %s >> %s 2>&1 &", refactor_script, filepath, model, log_file) + "bun", refactor_script, filepath, model } local job_id = vim.fn.jobstart(cmd, { - on_exit = function(_, exit_code) - active_jobs[job_id] = nil + on_exit = function(j_id, exit_code) + active_jobs[j_id] = nil if exit_code == 0 then vim.schedule(function() vim.cmd("checktime") -- Reload file if changed @@ -129,9 +126,6 @@ return { vim.keymap.set("n", "aX", refactor_with_model("X"), { desc = "Refactor with Grok-4 (high)" }) - - print("AI Refactor keybindings loaded: a[gisoX] for different models") - print("Use :RefactorJobs to view active jobs, :messages to view output") end, }, }