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

Telescope Current Buffer Fuzzy Find is showing last result #939

Closed
wiraki opened this issue May 17, 2024 · 4 comments
Closed

Telescope Current Buffer Fuzzy Find is showing last result #939

wiraki opened this issue May 17, 2024 · 4 comments

Comments

@wiraki
Copy link

wiraki commented May 17, 2024

Describe the bug

It is tricky to explain, but basically when I invoke Telescope fuzzy find in the current buffer (with default keymap +/) 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
@dam9000
Copy link
Contributor

dam9000 commented May 17, 2024

I could reproduce this, it's an issue in Telescope and is already fixed in the latest Telescope master branch, probably by this:
nvim-telescope/telescope.nvim#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

@wiraki
Copy link
Author

wiraki commented May 17, 2024

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?

@dam9000
Copy link
Contributor

dam9000 commented May 17, 2024

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

@wiraki
Copy link
Author

wiraki commented May 17, 2024

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

@wiraki wiraki closed this as completed May 17, 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

2 participants