snippet: Visual Highlights Get Stuck (snippet.lua:101: attempt to index a nil value) #29525
Labels
bug
issues reporting wrong behavior
needs:repro
We need minimal steps to reproduce the issue
snippet
Milestone
Problem
Visual highlights keep getting stuck. Happens often when I use a snippet like
rfcv
to generate a component inside of a new file. The snippet fails to include the name of the file. When I visually highlight something in the file and try to paste over it, the highlights get stuck. I then have to close and reopen the buffer to clear it. But when I reopen the buffer and begin to make changes, I get an error:Error executing lua callback: ... lar/neovim/0.10.0/share/nvim/runtime/lua/vim/snippet.lua:101: attempt to index a nil value
Video of the stuck visual highlight:
lazyvim-highlights-stuck.mov
Screenshot of errors once I close the buffer, reopen and begin to make changes to the buffer:
![Screenshot 2024-06-28 at 7 46 09 PM](https://private-user-images.githubusercontent.com/48610822/344493661-ed4a78f9-5708-45e7-ab4e-b301ed0ea093.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMjEzMDUsIm5iZiI6MTcyNjAyMTAwNSwicGF0aCI6Ii80ODYxMDgyMi8zNDQ0OTM2NjEtZWQ0YTc4ZjktNTcwOC00NWU3LWFiNGUtYjMwMWVkMGVhMDkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDAyMTY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJkMDA3MjZjODk4MjJhNjViNDBkMGNjOTNjMzc3Y2FiNjk1OWI4YWE4ZTFhNmJmMWZkNmVhZjU2YTg1ZmFjZjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mF-VxK185WW6xzQ1Q7vyfxVA-AZmYggSqsq-wm9NkeU)
As I start typing I get these errors on each keystroke:
Error detected while processing CursorMovedI Autocommands for "<buffer=268>":
Error detected while processing TextChangedI Autocommands for "<buffer=268>":
Steps to reproduce
rfcv
to generate a componentError executing lua callback: ... lar/neovim/0.10.0/share/nvim/runtime/lua/vim/snippet.lua:101: attempt to index a nil value
Expected behavior
There should be no error
Error executing lua callback: ... lar/neovim/0.10.0/share/nvim/runtime/lua/vim/snippet.lua:101: attempt to index a nil value
Neovim version (nvim -v)
0.10.0
Vim (not Nvim) behaves the same?
NA
Operating system/version
MacOS 14.4.1
Terminal name/version
Kitty 0.35.2
$TERM environment variable
xterm-kitty
Installation
homebrew
The text was updated successfully, but these errors were encountered: