mirror of
https://github.com/neovim/neovim.git
synced 2026-05-23 21:30:11 +00:00
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().
This commit is contained in:
@@ -60,11 +60,11 @@ vim.keymap.set({ 'n' }, '<A-l>', '<C-w>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,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user