summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/lua/thread_spec.lua
AgeCommit message (Collapse)AuthorFiles
2025-07-12fix(lua): vim.diff is nil in uv.new_work() thread #34909Justin M. Keyes1
Problem: The "gitsigns" plugin runs `vim.diff` in a thread (`uv.new_work`), but `vim.diff` is nil in that context: Lua callback: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil) stack traceback: [C]: in function 'decode' …/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29> Luv thread: …/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value) Solution: Revert the `stdlib.c` change (set `vim.diff` instead of `vim._diff`).
2025-07-12test: zig build thread_spec.lua failure after `vim.text.diff` renameJustin M. Keyes1
Problem: Since renaming `vim.diff` to `vim.text.diff`, `thread_spec.lua` fails in the zig build. Is `vim.text.diff` not available in the thread context? Why does it only fail in the zig build? FAILED ./test/functional/lua/thread_spec.lua @ 217: thread vim.* diff ./test/functional/lua/thread_spec.lua:229: Expected objects to be the same. Passed in: (nil) Expected: (table: 0x7f221d392218) { [1] = 'notification' E5113: Lua chunk: [2] = 'result' [3] = { [1] = '@@ -1 +1 @@ -Hello +Helli ' } } stack traceback: ./test/functional/lua/thread_spec.lua:229: in function <./test/functional/lua/thread_spec.lua:217> FAILED ./test/functional/lua/thread_spec.lua @ 372: threadpool vim.* work ./test/functional/lua/thread_spec.lua:384: Expected objects to be the same. Passed in: (table: 0x7f2225be2c30) { [1] = 'notification' [2] = 'result' *[3] = { *[1] = vim.NIL } } Expected: (table: 0x7f2225be25c0) { [1] = 'notification' [2] = 'result' *[3] = { *[1] = '@@ -1 +1 @@ -Hello +Helli ' } } stack traceback: ./test/functional/lua/thread_spec.lua:384: in function <./test/functional/lua/thread_spec.lua:372> Solution: Use `vim._diff` in the test, until a root cause is found.
2025-07-12refactor(lua): rename vim.diff => vim.text.diff #34864Justin M. Keyes1
Problem: `vim.diff()` was introduced before we had the `vim.text` module, where it obviously belongs. Solution: Move it.
2025-05-04feat(messages): cleanup Lua error messagesJustin M. Keyes1
"Error" in error messages is redundant. Just provide the context, don't say "Error ...".
2025-03-02docs: misc #31996Justin M. Keyes1
2025-01-18fix(lua): prevent SIGSEGV when lua error is NULL in libuv_worker林玮 (Jade Lin)1
Problem: Calling `xstrdup` with a NULL pointer causes a SIGSEGV if `lua_tostring` returns NULL in `nlua_luv_thread_common_cfpcall`. Crash stack trace: - `_platform_strlen` → `xstrdup` (memory.c:469) - `nlua_luv_thread_common_cfpcall` (executor.c:281) Solution: Check if `lua_tostring` returns NULL and pass NULL to `event_create` to avoid the crash.
2024-11-14fix(tests): needing two calls to setup a screen is cringebfredl1
Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
2024-08-14refactor(tests): again yet more global highlight definitionsbfredl1
2024-04-23test: improve test conventionsdundargoc1
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.
2024-03-11test: correct order of arguments to eq() (#27816)zeertzjq1
2024-01-12test: do not inject vim module into global helpersLewis Russell1
2024-01-03refactor: format test/*Justin M. Keyes1
2023-12-09test: avoid repeated screen lines in expected stateszeertzjq1
This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
2023-06-03feat(lua): rename vim.loop -> vim.uv (#22846)Lewis Russell1
2022-11-14feat(test): add Lua forms for API methods (#20152)Lewis Russell1
2022-03-03refactor(lua): reorganize builtin modules, phase 1bfredl1
2022-02-26refactor(lua): cleanup and docs for threadsbfredl1
2022-02-26feat(lua): add proper support of luv threadserw71