diff options
| author | Ayose C. <ayosec@gmail.com> | 2026-05-17 13:56:37 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-17 09:56:37 -0400 |
| commit | 3ace049c6a4d0580a0bcb485a30e8613c8a6b149 (patch) | |
| tree | cf6afcf4dc1818902559b4fc196e8dac6c40f5fe /runtime/example_init.lua | |
| parent | 8e1d6dfadaab011d30ca3a27437960c73ffbc9b7 (diff) | |
| download | rneovim-3ace049c6a4d0580a0bcb485a30e8613c8a6b149.tar.gz rneovim-3ace049c6a4d0580a0bcb485a30e8613c8a6b149.tar.bz2 rneovim-3ace049c6a4d0580a0bcb485a30e8613c8a6b149.zip | |
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().
Diffstat (limited to 'runtime/example_init.lua')
| -rw-r--r-- | runtime/example_init.lua | 4 |
1 files changed, 2 insertions, 2 deletions
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' }, '<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, }) |