ggandor / lightspeed.nvim

deprecated in favor of leap.nvim
MIT License
1.56k stars 28 forks source link

Error on yank after jumping #156

Open jacksonludwig opened 2 years ago

jacksonludwig commented 2 years ago

I noticed the following error occur after performing a yank immediately after moving using lightspeed. I have noticed it quite consistently if I jump while in visual mode then yank the selection, however I am still not totally able to always reproduce it.

Error detected while processing TextYankPost Autocommands for "*":
Error executing lua callback: /usr/local/share/nvim/runtime/lua/vim/highlight.lua:63: end_col value outside range
stack traceback:
        [C]: in function 'nvim_buf_set_extmark'
        /usr/local/share/nvim/runtime/lua/vim/highlight.lua:63: in function 'range'
        /usr/local/share/nvim/runtime/lua/vim/highlight.lua:134: in function 'on_yank'
        ...

I have highlight on yank set up this way:

local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
  callback = function()
    vim.highlight.on_yank()
  end,
  group = highlight_group,
  pattern = '*',
})

This could be an upstream issue, but I have not been reproduce the issue without lightspeed.

ggandor commented 2 years ago

A reproducible example would definitely help a lot...