summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/net.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-12docs: miscJustin M. Keyes1
Close #38748 Close #38866 Co-authored-by: Mario Loriedo <mario.loriedo@gmail.com> Co-authored-by: Anakin Childerhose <anakin@childerhose.ca>
2026-04-10feat(vim.net): custom request() headers #38837Ellison1
Problem Cannot specify headers in vim.net.request() call. Solution Support opts.headers in vim.net.request opts.
2026-04-05fix(vim.net): check if vim.system's stdout is nil #38713Yochem van Rosmalen1
Problem: Apparently vim.SystemCompleted.stdout can also be nil, even without a custom stdout handler. (Although the docs can be interpreted otherwise). Solution: Explicitly check for nil and set the result body to an empty string if stdout was nil.
2026-03-24fix(vim.net): always pass response body to on_response #38460Yochem van Rosmalen1
Problem: on_response(err, response) handler doesn't receive a response when an output buffer or path is supplied to vim.net.request. User might want to both output output to a file/buffer and also do something with it on response. Solution: If an on_response handler was given, then pass the response to it.
2026-03-24docs: api, plugins, ui2Justin M. Keyes1
2026-03-23feat(net): vim.net.request(outbuf) writes response to buffer #36164Yochem van Rosmalen1
Problem: Non-trivial to write output of vim.net.request to buffer. Requires extra code in plugin/net.lua which can't be reused by other plugin authors. ``` vim.net.request('https://neovim.io', {}, function(err, res) if not err then local buf = vim.api.nvim_create_buf(true, false) if res then local lines = vim.split(res.body, '\n', { plain = true }) vim.api.nvim_buf_set_lines(buf, 0, -1, true, lines) end end end) ``` Solution: Accept an optional `outbuf` argument to indicate the buffer to write output to, similar to `outpath`. vim.net.request('https://neovim.io', { outbuf = buf }) Other fixes / followups: - Make plugin/net.lua smaller - Return objection with close() method - vim.net.request.Opts class - vim.validate single calls - Use (''):format(...) instead of `..`
2026-01-27fix: misc typos #37471phanium1
2025-09-16docs: small fixes (#35791)zeertzjq1
Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
2025-07-28docs: lsp, ui events, dev guidance, osc7Justin M. Keyes1
fix #34981
2025-07-13feat(net): vim.net.request(), :edit [url] #34140Tom Ampuero1
Problem: Nvim depends on netrw to download/request URL contents. Solution: - Add `vim.net.request()` as a thin curl wrapper: - Basic GET with --silent, --show-error, --fail, --location, --retry - Optional `opts.outpath` to save to a file - Operates asynchronously. Pass an `on_response` handler to get the result. - Add integ tests (requires NVIM_TEST_INTEG to be set) to test success and 404 failure. - Health check for missing `curl`. - Handle `:edit https://…` using `vim.net.request()`. API Usage: 1. Asynchronous request: vim.net.request('https://httpbingo.org/get', { retry = 2 }, function(err, response) if err then print('Fetch failed:', err) else print('Got body of length:', #response.body) end end) 2. Download to file: vim.net.request('https://httpbingo.org/get', { outpath = 'out_async.txt' }, function(err) if err then print('Error:', err) end end) 3. Remote :edit integration (in runtime/plugin/net.lua) fetches into buffer: :edit https://httpbingo.org/get