summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/lua/net_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-04-20refactor(test): drop deprecated exc_exec #39242Justin M. Keyes1
2026-04-15test: replace busted with local harnessLewis Russell1
Replace the busted-based Lua test runner with a repo-local harness. The new harness runs spec files directly under `nvim -ll`, ships its own reporter and lightweight `luassert` shim, and keeps the helper/preload flow used by the functional and unit test suites. Keep the file boundary model shallow and busted-like by restoring `_G`, `package.loaded`, `package.preload`, `arg`, and the process environment between files, without carrying extra reset APIs or custom assertion machinery. Update the build and test entrypoints to use the new runner, add black-box coverage for the harness itself, and drop the bundled busted/luacheck dependency path. AI-assisted: Codex
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(net): handle remote archive URLs via tar/zip browse #38744Tom Ampuero1
Problem: Opening .tar.gz or .zip URLs shows raw binary instead of using the archive plugins. Solution: Similar to the original netrw implementation, the autocmd should detect archive URLs, download them to a temp file and the open them with tar/zip handlers already bundled as vim plugins.
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 `..`
2025-11-22refactor: deduplicate testJustin M. Keyes1
2025-11-19fix(vim.net): filetype detection, mark unmodified #36297Michele Sorcinelli1
Problem: When running ":edit <url>", filetype detection is not triggered. Solution: Run the autocmds in the filetypedetect group after loading the content. Problem: After fetching remote content from a URL and adding it to the buffer, the buffer is marked as modified. This is inconsistent with the original netrw behavior, and it causes problems with `:e` to refresh or `:q` as it prompts for saving the file even if the user hasn't touched the content at all. Solution: Mark the buffer as unmodified right after adding the remote content to the buffer.
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