Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Error detected while processing CursorMoved Autocommands for "*": in function matchdelete() #31

Open
ibrahimmkhalid opened this issue Dec 21, 2023 · 0 comments

Comments

@ibrahimmkhalid
Copy link

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)

  1. minimal init.lua: https://pastebin.com/DUp8H0Yx
  2. open a file with some text greater than 3 characters
  3. move cursor over to that word
  4. open quick menu with mm
  5. error!

How to reproduce (general case)

  1. open a file with some text greater than 3 characters
  2. move cursor over to that word
  3. do ":call clearmatches()"
  4. 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

cg1937 added a commit to cg1937/nvim-cursorline that referenced this issue Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant