diff options
author | Siddhant Agarwal <68201519+siddhantdev@users.noreply.github.com> | 2025-04-03 19:56:56 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-03 07:26:56 -0700 |
commit | eae2d3b145c724e8c801c7c22a2ccc3bde5534eb (patch) | |
tree | d30812a2e6b14b82aab0eb05085f424abaf84c04 /runtime/doc | |
parent | 974a3aa2c4c34f97ce015466a7dfc5fd727fccc2 (diff) | |
download | rneovim-eae2d3b145c724e8c801c7c22a2ccc3bde5534eb.tar.gz rneovim-eae2d3b145c724e8c801c7c22a2ccc3bde5534eb.tar.bz2 rneovim-eae2d3b145c724e8c801c7c22a2ccc3bde5534eb.zip |
feat(vim.hl): allow multiple timed highlights simultaneously #33283
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.
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lua.txt | 6 | ||||
-rw-r--r-- | runtime/doc/news.txt | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index be118cf790..c580c55a5e 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -640,6 +640,12 @@ vim.hl.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {opts}) • {timeout}? (`integer`, default: -1 no timeout) Time in ms before highlight is cleared + Return (multiple): ~ + (`uv.uv_timer_t?`) range_timer A timer which manages how much time the + highlight has left + (`fun()?`) range_clear A function which allows clearing the highlight + manually. nil is returned if timeout is not specified + ============================================================================== VIM.DIFF *vim.diff* diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 72ab3373f7..72d394dd68 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -104,7 +104,7 @@ The following new features were added. API -• todo +• |vim.hl.range()| now allows multiple timed highlights DEFAULTS |