Hi there! First of all, really thank you for this plugin. I never knew I needed it until I tried haha!
Since I notice that arrow fails when there's no such a highlight as Cursor. It happens because of the deprecated nvim_get_hl_by_name method. If there's no such a highlight, it just throws an error.
But! When I started fixing the error, I found a data leak in BufLeave autocmd. You can clearly see it if you open and close arrow.nvim 10 times and then check your autocmds by :autocmd. You'll see 10 BufLeave autocmds. I fixed it in the first commit.
Returning back to the original issue - I don't really see the reason overcomplicating in that place, but maybe I'm missing anything? I just created a dummy highlight and shadowed the original cursor highlight. When leaving a buffer, I just deleted the highlight and the cursor setting for it.
P.S. just noticed that in the buffer_ui.lua there're the same errors. Created fixes for those as well!
Hi there! First of all, really thank you for this plugin. I never knew I needed it until I tried haha!
Since I notice that
arrow
fails when there's no such a highlight asCursor
. It happens because of the deprecatednvim_get_hl_by_name
method. If there's no such a highlight, it just throws an error.But! When I started fixing the error, I found a data leak in
BufLeave
autocmd. You can clearly see it if you open and closearrow.nvim
10 times and then check your autocmds by:autocmd
. You'll see 10BufLeave
autocmds. I fixed it in the first commit.Returning back to the original issue - I don't really see the reason overcomplicating in that place, but maybe I'm missing anything? I just created a dummy highlight and shadowed the original cursor highlight. When leaving a buffer, I just deleted the highlight and the cursor setting for it.
P.S. just noticed that in the
buffer_ui.lua
there're the same errors. Created fixes for those as well!