nvim-telescope / telescope-fzf-native.nvim

FZF sorter for telescope written in c
1.36k stars 45 forks source link

Live grep slow under specific repositories #75

Closed afterlook closed 2 years ago

afterlook commented 2 years ago

Description

I have a very specific case where live grep starts to slow down a lot to a point that it hangs after every keystroke and is not usable at all.

This only happens when neovim is opened in this specific repository https://github.com/kumahq/kuma. Any live search will slow down after 3-5 characters or hang completely.

It doesn't happen when for example I open neovim in a directory with multiple repositories including the before mentioned kuma.

It doesn't happen when I run exact searches from root for a whole filesystem.

Neovim version

NVIM v0.7.0 Build type: Release LuaJIT 2.1.0-beta3

Operating system and version

macOS 12.4

Reproduce

Default configuration

-- You dont need to set any of these options. These are the default ones. Only
-- the loading is important
require('telescope').setup {
  extensions = {
    fzf = {
      fuzzy = true,                    -- false will only do exact matching
      override_generic_sorter = true,  -- override the generic sorter
      override_file_sorter = true,     -- override the file sorter
      case_mode = "smart_case",        -- or "ignore_case" or "respect_case"
                                       -- the default case_mode is "smart_case"
    }
  }
}
-- To get fzf loaded and working with telescope, you need to call
-- load_extension, somewhere after setup function:
require('telescope').load_extension('fzf')
Conni2461 commented 2 years ago

live_grep doesn't use a sorter, so it doesn't use fzf_native.

But its most likely the previewer, trying to preview a file and highlighting takes forever. That happens for me with min.js files. What i do is :Telescope live_grep previewer=false and then i toggle the previewer as soon as i need it. You need to map toggle previewer see :help telescope.actions.layout.toggle_preview()

Hope that helps, if not maybe open a new issue in telescope.nvim project. Thanks :)

ssh352 commented 2 years ago

live_grep doesn't use a sorter, so it doesn't use fzf_native.

oh that's why live_grep can't use fzf syntax. Thanks for pointing out