Skip to content

Commit

Permalink
feat: RestRequestPost/RestResponsePost autocmds (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
mawkler committed Jan 9, 2025
1 parent 5455092 commit a5fbe09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/rest-nvim/request.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ local function run_request(req)
_G.rest_request = nil

ui.update({ request = req })
vim.api.nvim_exec_autocmds("User", {
pattern = { "RestRequestPost" },
})

-- NOTE: wrap with schedule to do vim stuffs outside of lua callback loop (`on_exit`
-- callback from `vim.system()` call)
Expand Down Expand Up @@ -92,6 +95,9 @@ local function run_request(req)

-- update result UI
ui.update({ response = res })
vim.api.nvim_exec_autocmds("User", {
pattern = { "RestResponsePost" },
})
end)
-- FIXME(boltless): return future to pass the command state
end
Expand Down

0 comments on commit a5fbe09

Please sign in to comment.