runtime(hlyank): verify winid in lambda before matchdelete()

Commit: 
https://github.com/vim/vim/commit/01be43047f657b0afed488cf871a612d83abe087
Author: Christian Brabandt <[email protected]>
Date:   Sat Apr 11 14:53:48 2026 +0000

    runtime(hlyank): verify winid in lambda before matchdelete()
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim 
b/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim
index 4b568fae2..3e0cdb9bf 100644
--- a/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim
+++ b/runtime/pack/dist/opt/hlyank/plugin/hlyank.vim
@@ -1,7 +1,7 @@
 vim9script
 
 # Highlight Yank plugin
-# Last Change: 2025 Mar 22
+# Last Change: 2026 Apr 11
 
 def HighlightedYank()
 
@@ -28,7 +28,11 @@ def HighlightedYank()
       return [v[0][1], col_beg, col_end - col_beg]
     }))
     var winid = win_getid()
-    timer_start(duration, (_) => m->matchdelete(winid))
+    timer_start(duration, (_) => {
+      if winbufnr(winid) != -1
+        m->matchdelete(winid)
+      endif
+    })
   endif
 enddef
 

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wBZob-00F1Ud-38%40256bit.org.

Raspunde prin e-mail lui