Skip to content

Commit f94c795

Browse files
rochacbrunoteto
authored andcommitted
Add default opts for .run_request function
Allow users to call `.run()` without passing `true|false` for verbose parameter. relates #166
1 parent 60365bf commit f94c795

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/rest-nvim/init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ end
5555

5656
rest.run_request = function(req, opts)
5757
local result = req
58+
opts = vim.tbl_deep_extend(
59+
"force", -- use value from rightmost map
60+
{verbose = false}, -- defaults
61+
opts or {}
62+
)
63+
5864
Opts = {
5965
method = result.method:lower(),
6066
url = result.url,

0 commit comments

Comments
 (0)