-
Couldn't load subscription status.
- Fork 27
Description
Issue
If ":call clearmatches()" was performed, it would break the cursorword highlighting for that window
Error detected while processing CursorMoved Autocommands for "*":
Error executing lua callback: Vim:E803: ID not found: 1000
stack traceback:
[C]: in function 'call'
...rline-debug/lazy/nvim-cursorline/lua/nvim-cursorline.lua:35: in function 'matchadd'
...rline-debug/lazy/nvim-cursorline/lua/nvim-cursorline.lua:96: in function <...rline-debug/lazy/nvim-cursorline/lua/nvim-cursorline.lua:95>
Discovery
I discovered this bug while installing and testing out ThePrimeagen's latest harpoon update. When opening the harpoon menu, the clearmatches() function was called. This would cause an error message to pop up anytime the cursor moved in the popup menu. Closing the popup menu would fix it in the open file however.
I believe this is a bug in this plugin as there is a check on the existence of cursorword_id on the w object, but that does not take into account whether that that id actually gets deleted.
How to reproduce (discovery)
- minimal init.lua: https://pastebin.com/DUp8H0Yx
- open a file with some text greater than 3 characters
- move cursor over to that word
- open quick menu with mm
- error!
How to reproduce (general case)
- open a file with some text greater than 3 characters
- move cursor over to that word
- do ":call clearmatches()"
- error!
Fix
PR: #30
p.s. I am new to open source development. If there's anything i can fix about my post, please let me know. I would really appreciate it