Bugfix: Unsafe check on cursorword_id#30
Conversation
|
Thanks for the fix proposal and clear repro steps. I reviewed this patch and found a few issues that likely prevent it from fixing the root cause:
Suggested minimal fix: (Equivalent vim.fn.matchdelete variant is also fine.)
|
|
pulled in changes from upstream and incorporated the pcall into the |
Since there is no testing setup in the repo as of now, I did not add explicit tests, however I tested it on my system and it seems to be working without any issues. Let me know if you find anything that needs fixing or any other comments and I will try incorporating them. Thanks! |
Issue
If ":call clearmatches()" was performed, it would break the cursorword highlighting for that window
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_idon thewobject, but that does not take into account whether that that id actually gets deleted.How to reproduce (discovery)
How to reproduce (general case)
Fix
Move deletion into a
pcallfunction and retain previous code flow with theifcheck.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