Skip to content

Commit 642c9ed

Browse files
omrisarig13Omri Sarig
authored andcommitted
fix: rename vim.highlight.on_yank to vim.hl.on_yank (nvim-lua#1482)
The functions of vim.highlight were renamed to vim.hl on commit 18b43c331d8a0ed87d7cbefe2a18543b8e4ad360 of neovim, which was applied with the release of nvim version 0.11. Now, the use of vim.highlight is deprecated, and instead, one should use vim.hl functions. In practice, vim.highlight is still working, however, asking for help for vim.highlight.on_yank fails (E149), while asking for help for vim.hl.on_yank works as expected. So, by updating the used function, a new user will have easier time looking getting the relevant help. Co-authored-by: Omri Sarig <[email protected]>
1 parent f7e0bb8 commit 642c9ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
211211

212212
-- Highlight when yanking (copying) text
213213
-- Try it with `yap` in normal mode
214-
-- See `:help vim.highlight.on_yank()`
214+
-- See `:help vim.hl.on_yank()`
215215
vim.api.nvim_create_autocmd('TextYankPost', {
216216
desc = 'Highlight when yanking (copying) text',
217217
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
218218
callback = function()
219-
vim.highlight.on_yank()
219+
vim.hl.on_yank()
220220
end,
221221
})
222222

0 commit comments

Comments
 (0)