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

Telescope Current Buffer Fuzzy Find is showing last result

Open wiraki opened this issue 1 year ago • 1 comments

Describe the bug

It is tricky to explain, but basically when I invoke Telescope fuzzy find in the current buffer (with default keymap <Leader>+/) and type in a search string, I am often shown only the last-scoring result. I then need to scroll up or down to see the other results, and importantly the best matches. Here is a screenshot of searching for "leader" inside the kickstart init.lua, just after I finish typing the search string:

image

To Reproduce

  1. Install neovim 0.10
  2. Get kickstart's init.lua as config.
  3. Open a file and invoke telescope current buffer fuzzy find with <Leader>+/
  4. Search for a string.

Desktop

  • OS: Pop!_OS 22.04 LTS x86_64
  • Terminal: kitty 0.34.1

Neovim Version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068

wiraki avatar May 17 '24 11:05 wiraki

I could reproduce this, it's an issue in Telescope and is already fixed in the latest Telescope master branch, probably by this: https://github.com/nvim-telescope/telescope.nvim/pull/3109 fix: adapt to Nvim deprecations in 0.10

Change your Telescope plugin spec to use master branch instead, just remove the branch field:

diff --git a/init.lua b/init.lua
index 88658ef..c7f2be4 100644
--- a/init.lua
+++ b/init.lua
@@ -306,7 +306,7 @@ require('lazy').setup({
   { -- Fuzzy Finder (files, lsp, etc)
     'nvim-telescope/telescope.nvim',
     event = 'VimEnter',
-    branch = '0.1.x',
+    --branch = '0.1.x',
     dependencies = {
       'nvim-lua/plenary.nvim',
       { -- If encountering errors, see telescope-fzf-native README for installation instructions

dam9000 avatar May 17 '24 13:05 dam9000

Removed the branch field, but then <leader>/ raises this error:

E5108: Error executing lua: ...ck/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:486: attempt to call field 'has_ts_parser' (a nil value)                                                                                                          
stack traceback:                                                                                                                                                                                                                                          
        ...ck/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:486: in function 'v'                                                                                                                                                                  
        ...ck/lazy/telescope.nvim/lua/telescope/builtin/__files.lua:641: in function 'v'                                                                                                                                                                  
        ...-kick/lazy/telescope.nvim/lua/telescope/builtin/init.lua:542: in function 'current_buffer_fuzzy_find'  

When Lazy updated the Telescope plugin (after removing the branch field), it did print a changelog and mentioning "breaking changes" but I did not pay attention to the details. Maybe one of those changes is affecting now?

wiraki avatar May 17 '24 20:05 wiraki

I don't know, the change works for me. Try running :Lazy and update (U) or sync (S) all the plugins.

dam9000 avatar May 17 '24 21:05 dam9000

Indeed, I think the Sync did it. Thank you very much :pray:

wiraki avatar May 17 '24 21:05 wiraki