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

setting file_ignore_patterns seems to break current_buffer_fuzzy_find #3318

Open
madelaney opened this issue Oct 5, 2024 · 3 comments
Open
Labels
bug Something isn't working not reproducible

Comments

@madelaney
Copy link

Description

When I set defaults.file_ignore_patterns, any calls to builtin.current_buffer_fuzzy_find does not yield any results; when there should be something.

Neovim version

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382

Operating system and version

macOS 15.0.1

Telescope version / branch / rev

eae0d8f

checkhealth telescope

==============================================================================
telescope: health#telescope#check

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 14.1.1
- OK fd: found fd 10.2.0

===== Installed extensions ===== ~

Telescope Extension: `bookmarks` ~
- No healthcheck provided

Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured

Telescope Extension: `live_grep_args` ~
- No healthcheck provided

Telescope Extension: `notify` ~
- No healthcheck provided

Telescope Extension: `smart_history` ~
- No healthcheck provided

Telescope Extension: `ui-select` ~
- No healthcheck provided

Steps to reproduce

  1. setup telescope.
  2. update file_ignore_patterns
  3. open builtin.current_buffer_fuzzy_find

Expected behavior

I would see results, from the current buffer, that match the expression I entered.

Actual behavior

The window is opened, but no search results are returned; when they should.

Minimal config

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs { "config", "data", "state", "cache" } do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
  vim.fn.system {
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  {
    "nvim-telescope/telescope.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
    },
    config = function()
      -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
      require("telescope").setup({
        defaults = {
          file_ignore_patterns = {
            '.git',
            'target',
          }
        }
      }
    end,
  },
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
@madelaney madelaney added the bug Something isn't working label Oct 5, 2024
@jamestrew
Copy link
Contributor

Are you sure the current buffer doesn't match the patterns in file_ignore_patterns? FYI it is lua patterns not globs.

I'm not able to replicate this.

telescope-ignore-curbuffzy.mp4

@madelaney
Copy link
Author

Very interesting. Thank you for looking @jamestrew. On my system, those lines are the one that cause current_buffer_fuzzy_find to stop working but clearly I missed something. I'll dig a little more.

@chama-chomo
Copy link

chama-chomo commented Oct 26, 2024

I have the same problem..
having this in my config
file_ignore_patterns = { "node_modules", ".git", "build", "dist", "yarn.lock" },

is breaking fuzzy find inside a buffer that has nothing to do with the ignore patterns above.

After I comment file_ignore_patterns out or remove specifically '.git', fuzzy find gets fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working not reproducible
Projects
None yet
Development

No branches or pull requests

3 participants