From af6dbbc3a704a5a428406372f8db4b9ba1090b2f Mon Sep 17 00:00:00 2001 From: NicolasGB Date: Tue, 18 Nov 2025 11:09:24 +0100 Subject: [PATCH] fix(cmd): Improve default command parsing logic, to allow for builtin functionalities to be used --- lua/jj/utils.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/jj/utils.lua b/lua/jj/utils.lua index 0d5c60f..d42ee9a 100644 --- a/lua/jj/utils.lua +++ b/lua/jj/utils.lua @@ -102,9 +102,10 @@ end --- @param cmd string The command to execute --- @param error_prefix string|nil Optional error message prefix --- @param input string|nil Optional input to pass to stdin +--- @param silent boolean|nil Optional to silent the notification --- @return string|nil output The command output, or nil if failed --- @return boolean success Whether the command succeeded -function M.execute_command(cmd, error_prefix, input) +function M.execute_command(cmd, error_prefix, input, silent) local output if input then output = vim.fn.system(cmd, input) @@ -120,7 +121,10 @@ function M.execute_command(cmd, error_prefix, input) else error_message = output end - M.notify(error_message, vim.log.levels.ERROR) + if not silent then + M.notify(error_message, vim.log.levels.ERROR) + end + return nil, false end