feat(lua): vim.hl.range() "timeout" #32012

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()`.
This commit is contained in:
Siddhant Agarwal
2025-01-22 21:16:24 +05:30
committed by GitHub
parent 34344b939c
commit af0ef2ac9d
4 changed files with 53 additions and 17 deletions

View File

@@ -685,6 +685,8 @@ vim.hl.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {opts})
whether the range is end-inclusive
• {priority}? (`integer`, default:
`vim.hl.priorities.user`) Highlight priority
• {timeout}? (`integer`, default: -1 no timeout) Time in ms
before highlight is cleared
==============================================================================

View File

@@ -194,6 +194,7 @@ API
highlight group IDs.
• |nvim_open_win()| `relative` field can be set to "laststatus" and "tabline".
• |nvim_buf_set_extmark()| `hl_group` field can be an array of layered groups
• |vim.hl.range()| now has a optional `timeout` field which allows for a timed highlight
DEFAULTS