diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-07-11 08:33:29 -0400 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2025-07-28 22:00:25 -0400 |
| commit | 56a4ef3c213d87bfba5f361376bd23eefdf6c6ec (patch) | |
| tree | e300471cee1caaf3b86b4f38727ed95801b7c124 /runtime/lua/vim/net.lua | |
| parent | dc67ba948eec0a5628eff0b15ce87a7d27f58bb3 (diff) | |
| download | rneovim-56a4ef3c213d87bfba5f361376bd23eefdf6c6ec.tar.gz rneovim-56a4ef3c213d87bfba5f361376bd23eefdf6c6ec.tar.bz2 rneovim-56a4ef3c213d87bfba5f361376bd23eefdf6c6ec.zip | |
docs: lsp, ui events, dev guidance, osc7
fix #34981
Diffstat (limited to 'runtime/lua/vim/net.lua')
| -rw-r--r-- | runtime/lua/vim/net.lua | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/runtime/lua/vim/net.lua b/runtime/lua/vim/net.lua index 199b115e93..cd36e3027a 100644 --- a/runtime/lua/vim/net.lua +++ b/runtime/lua/vim/net.lua @@ -40,17 +40,11 @@ function M.request(url, opts, on_response) table.insert(args, url) local function on_exit(res) - local err_msg = nil - local response = nil - - if res.code ~= 0 then - err_msg = (res.stderr ~= '' and res.stderr) - or string.format('Request failed with exit code %d', res.code) - else - response = { - body = opts.outpath and true or res.stdout, - } - end + local s = 'Request failed with exit code %d' + local err_msg = res.code ~= 0 + and ((res.stderr ~= '' and res.stderr) or string.format(s, res.code)) + or nil + local response = res.code == 0 and { body = opts.outpath and true or res.stdout } or nil if on_response then on_response(err_msg, response) |