snacks.nvim icon indicating copy to clipboard operation
snacks.nvim copied to clipboard

bug: smooth scroll in picker preview may scroll to wrong place

Open Kaiser-Yang opened this issue 7 months ago • 1 comments

Did you check docs and existing issues?

  • [x] I have read all the snacks.nvim docs
  • [x] I have updated the plugin to the latest version before submitting this issue
  • [x] I have searched the existing issues of snacks.nvim
  • [x] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.11.0

Operating system/version

WSL-2 ubuntu 24.04

Describe the bug

When using grep picker to find content of a file and switching items of list from file a's item to file b's item, the animation of preview may stop at the wrong place.

Steps To Reproduce

  1. Make a test directory and two files a and b
  2. Put those contents to file a and file b
# a
word
... many empty lines here
word
# b
... many empty lines here
word
... many empty lines here
  1. Search word by grep picker, there will be three items as shown below:

Image

  1. When select item up and down the animation will start, when we switch from the last item to the first item fast enough, which means the animation of a:63 and a:1 not finished when switching from a:1 to b:18, the animation of switch between a:1 and a:63 will continue on the b:18's preview, which will cause the preview of b:18 at the wrong place:

Image

Expected Behavior

When switching between different files, disable the unfinished animation.

Kaiser-Yang avatar Apr 29 '25 10:04 Kaiser-Yang

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar May 30 '25 02:05 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jun 06 '25 02:06 github-actions[bot]

Sorry it took so long to fix, but thank you so much for the perfect way to reproduce this. This has been super helpful in finding the issue. ty!

folke avatar Oct 22 '25 20:10 folke