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

snippet: Visual Highlights Get Stuck (snippet.lua:101: attempt to index a nil value) #29525

Closed
alivault opened this issue Jun 30, 2024 · 3 comments
Labels
bug issues reporting wrong behavior needs:repro We need minimal steps to reproduce the issue snippet
Milestone

Comments

@alivault
Copy link

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

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

  1. Create a new file
  2. Use rfcv to generate a component
  3. Notice that the file name is missing from the snippet
  4. Type in a component name
  5. Visually highlight the contents of the render and paste over it
  6. Notice that the text and highlight gets stuck. Escaping fails to clear the highlight.
  7. Close the buffer and reopen
  8. Make changes to some text
  9. Notice the error: Error 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

@alivault alivault added the bug issues reporting wrong behavior label Jun 30, 2024
@zeertzjq zeertzjq added the needs:repro We need minimal steps to reproduce the issue label Jun 30, 2024
@chrisliaw
Copy link

chrisliaw commented Jul 31, 2024

I've been bother by this issue too but unfortunately it is not consistent.

It some times will go away after few saves but some time it keep throwing out. Sometime restart the neovim it will be gone for a while and after a while, it come back on different source file. I'm not sure how to reproduce this. How can we support this? Anything else to look for?

But to clarify, I'm on Elixir project, not the same env as the author still the issue is the same

@chrisliaw
Copy link

chrisliaw commented Aug 1, 2024

Screenshot 2024-08-01 at 11 46 56 AM

Only managed to capture few in actual the error filled up the whole right side covering all the text. Any movement like edit typing shall generate a new error to the list.

Some screenshot on the output sorry have to mask the background due to IP issue...

@justinmk justinmk added this to the backlog milestone Aug 15, 2024
@justinmk justinmk changed the title Visual Highlights Get Stuck (snippet.lua:101: attempt to index a nil value) snippet: Visual Highlights Get Stuck (snippet.lua:101: attempt to index a nil value) Aug 15, 2024
@maxkemzi
Copy link

maxkemzi commented Sep 9, 2024

The neovim 0.10.1 update seems to have solved the problem. If the problem occurs again, I will report it. Share if the 0.10.1 update solved the problem for you as well.

@clason clason closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior needs:repro We need minimal steps to reproduce the issue snippet
Projects
None yet
Development

No branches or pull requests

7 participants