From 3ace049c6a4d0580a0bcb485a30e8613c8a6b149 Mon Sep 17 00:00:00 2001 From: "Ayose C." Date: Sun, 17 May 2026 13:56:37 +0000 Subject: feat(vim.hl): vim.hl.hl_op() #39777 Problem: vim.hl.on_yank() only works for TextYankPost, not TextPutPost. Solution: Introduce hl_op(). Deprecate on_yank(). --- runtime/example_init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/example_init.lua') diff --git a/runtime/example_init.lua b/runtime/example_init.lua index 3ebe6f7dc7..511194a380 100644 --- a/runtime/example_init.lua +++ b/runtime/example_init.lua @@ -60,11 +60,11 @@ vim.keymap.set({ 'n' }, '', 'l') -- See `:h lua-guide-autocommands`, `:h autocmd`, `:h nvim_create_autocmd()` -- Highlight when yanking (copying) text. --- Try it with `yap` in normal mode. See `:h vim.hl.on_yank()` +-- Try it with `yap` in normal mode. See `:h vim.hl.hl_op()` vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', callback = function() - vim.hl.on_yank() + vim.hl.hl_op() end, }) -- cgit