aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/hl_spec.lua
Commit message (Collapse)AuthorAge
* fix(vim.hl): convert finish column independently #41618Volodymyr Chernetskyi2026-09-02
| | | | | | | | | | | Problem: Coordinates-to-position conversion for the finish column in `vim.hl.range()` checks the start column. This results in an incorrect finish column when only one of the column coordinates is `vim.v.maxcol`. Solution: Check the finish column when converting the finish position. Update the existing screen test so that a `vim.v.maxcol` finish highlights the end-of-line marker, matching the existing `-1` behavior.
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* fix(vim.hl): range(0,…) highlight not cleared after buffer-switch #40130Justin M. Keyes2026-06-06
| | | | | | | | | | Problem: When `vim.hl.range(0, …, { timeout = N })` is called, the deferred `range_hl_clear` captures `buf=0`, which resolves to an arbitrary "current buffer" at timeout. This may cause a stale highlight that never gets cleared. Solution: Resolve `buf=0` explicitly, before `range_hl_clear` captures it.
* feat(vim.hl): vim.hl.hl_op() #39777Ayose C.2026-05-17
| | | | | | | | Problem: vim.hl.on_yank() only works for TextYankPost, not TextPutPost. Solution: Introduce hl_op(). Deprecate on_yank().
* fix(vim.hl): nvim_buf_del_extmark on invalid buffer #33331phanium2025-04-05
| | | | | | | Problem: nvim_buf_del_extmark error if buffer is destroyed before timer stops Solution: check nvim_buf_is_valid.
* test(lua/hl_spec): fix hang on exit with ASAN (#33298)zeertzjq2025-04-04
|
* feat(vim.hl): allow multiple timed highlights simultaneously #33283Siddhant Agarwal2025-04-03
| | | | | | | | | Problem: Currently vim.hl.range only allows one timed highlight. Creating another one, removes the old one. Solution: vim.hl.range now returns a timer and a function. The timer keeps track of how much time is left in the highlight and the function allows you to clear it, letting the user decide what to do with old highlights.
* fix(lua): vim.hl.on_yank highlights wrong region with yi' (#32850)phanium2025-03-13
| | | | | | | Problem: yi' don't highlight last character since https://github.com/neovim/neovim/commit/8ce504820af04194a41acbe1f4c61cf12bd5feb5. Solution: Always use `opts.inclusive=true`, since calculation of `"]` (`b_op_end`) have taken `inclusive` into account.
* test(lua/hl_spec): fix hang on exit with ASAN (#32508)zeertzjq2025-02-18
|
* test(lua/hl_spec): reduce flakiness (#32489)zeertzjq2025-02-17
|
* test(lua/hl_spec): set timeout for transient state (#32169)zeertzjq2025-01-23
|
* feat(lua): vim.hl.range() "timeout" #32012Siddhant Agarwal2025-01-22
| | | | | | | | Problem: `vim.hl.on_yank()` has a "timeout" behavior but this is not available for `vim.hl.range()`. Solution: Add `timeout` arg to `vim.hl.range()`.
* refactor: use nvim.foo.bar format for namespacesMaria José Solano2025-01-14
|
* fix(tests): needing two calls to setup a screen is cringebfredl2024-11-14
| | | | | | | | | | 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.
* refactor: rename vim.highlight => vim.hlJustin M. Keyes2024-10-21
Problem: - `vim.highlight` module does not follow `:help dev-name-common`, which documents the name for "highlight" as "hl". - Shorter names are usually preferred. Solution: Rename `vim.highlight` to `vim.hl`. This is not a breaking change until 2.0 (or maybe never).