File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -95,15 +95,30 @@ rest.run_request = function(req, opts)
9595 request .highlight (result .bufnr , result .start_line , result .end_line )
9696 end
9797
98+ local request_id = vim .loop .now ()
99+ local data = {
100+ requestId = request_id ,
101+ request = req
102+ }
103+
104+ vim .api .nvim_exec_autocmds (" User" , {
105+ pattern = " RestStartRequest" ,
106+ modeline = false ,
107+ data = data
108+ })
98109 local success_req , req_err = pcall (curl .curl_cmd , Opts )
110+ vim .api .nvim_exec_autocmds (" User" , { pattern = " RestStopRequest" , modeline = false ,
111+ data = vim .tbl_extend (" keep" , { status = success_req , message = req_err }, data ) })
99112
100113 if not success_req then
101114 vim .api .nvim_err_writeln (
102115 " [rest.nvim] Failed to perform the request.\n Make sure that you have entered the proper URL and the server is running.\n\n Traceback: "
103116 .. req_err
104117 )
105118 return false , req_err
119+
106120 end
121+
107122end
108123
109124-- last will run the last curl request, if available
You can’t perform that action at this time.
0 commit comments