@@ -19,27 +19,25 @@ M.lazy_cmd = function(command, args, opts)
1919 args = args or {}
2020 local cwd = opts .cwd or vim .fn .getcwd ()
2121
22- Job
23- :new ({
24- command = command ,
25- args = args ,
26- cwd = cwd ,
27- on_exit = vim .schedule_wrap (function (job , ret )
28- local stderr = table.concat (job :stderr_result (), vim .g .nl )
29- local stdout = table.concat (job :result (), vim .g .nl )
22+ Job :new ({
23+ command = command ,
24+ args = args ,
25+ cwd = cwd ,
26+ on_exit = vim .schedule_wrap (function (job , ret )
27+ local stderr = table.concat (job :stderr_result (), vim .g .nl )
28+ local stdout = table.concat (job :result (), vim .g .nl )
3029
31- if ret == 0 then
32- if opts .on_success then
33- opts .on_success (stdout , stderr )
34- end
35- else
36- if opts .on_error then
37- opts .on_error (stdout , stderr , ret )
38- end
30+ if ret == 0 then
31+ if opts .on_success then
32+ opts .on_success (stdout , stderr )
3933 end
40- end ),
41- })
42- :start ()
34+ else
35+ if opts .on_error then
36+ opts .on_error (stdout , stderr , ret )
37+ end
38+ end
39+ end ),
40+ }):start ()
4341 end
4442end
4543
@@ -73,11 +71,7 @@ local function lazy_cmd_with_window(command, opts, desc)
7371 popupwin .append (stderr )
7472 else
7573 vim .notify (
76- command
77- .. ' '
78- .. table.concat (args , ' ,' )
79- .. ' failed: '
80- .. stderr
74+ command .. ' ' .. table.concat (args , ' ,' ) .. ' failed: ' .. stderr
8175 )
8276 end
8377 end ,
@@ -89,7 +83,8 @@ M.lazy_cmd_with_window = lazy_cmd_with_window
8983M .lazy_cmd_with_fidget = function (command , args , opts )
9084 return function ()
9185 opts = opts or {}
92- local command_full = string.format (' %s %s' , command , table.concat (args , ' ' ))
86+ local command_full =
87+ string.format (' %s %s' , command , table.concat (args , ' ' ))
9388
9489 -- Create fidget progress handle
9590 local fidget_progress = require (' fidget.progress' )
@@ -106,6 +101,9 @@ M.lazy_cmd_with_fidget = function(command, args, opts)
106101 if stdout ~= ' ' then
107102 vim .notify (stdout , vim .log .levels .INFO )
108103 end
104+ if stderr ~= ' ' then
105+ vim .notify (stderr , vim .log .levels .ERROR )
106+ end
109107 handle :finish ()
110108 end ,
111109 on_error = function (stdout , stderr , ret )
0 commit comments