nvim-telescope / telescope-frecency.nvim

A telescope.nvim extension that offers intelligent prioritization when selecting files from your editing history.
MIT License
688 stars 34 forks source link

`show_unindexed` showing ignored files #211

Open joey-slingshot opened 1 month ago

joey-slingshot commented 1 month ago

I'm not sure if this is intended behavior, but when I have show_unindexed set to true (I do this for git repos I haven't used with nvim before so I can search for files that haven't been index), if I open the frecency window, I still see files inside the .git directory although I've tried the ignore_patterns settings at both the root and extension levels.

My telescope config looks like this:

      require('telescope').setup {
        defaults = {
          file_ignore_patterns = { '*.git' },
        },
        extensions = {
          frecency = {
            ignore_patterns = { '*.git' },
            show_unindexed = true,
            db_safe_mode = false,
            auto_validate = false,
            default_workspace = 'CWD',
          },
        },
      }
delphinus commented 1 month ago

Hmm, I can't reproduce.

  1. I wrote a minimal init.lua to ~/.config/nvim-frecency/init.lua like below,

    code: ~/.config/nvim-frecency/init.lua ```lua local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system { "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release lazypath, } end vim.opt.rtp:prepend(lazypath) require("lazy").setup { { "nvim-telescope/telescope.nvim", dependencies = { { "nvim-lua/plenary.nvim" }, { "nvim-telescope/telescope-frecency.nvim" }, }, config = function() require("telescope").setup { defaults = { file_ignore_patterns = { "*.git" }, }, extensions = { frecency = { ignore_patterns = { "*.git" }, show_unindexed = true, db_safe_mode = false, auto_validate = false, default_workspace = "CWD", }, }, } end, }, } ```
  2. Run env NVIM_APPNAME=nvim-frecency nvim

  3. Run :Telescope frecency

  4. But I cannot see entries below .git dir.

Two points I want to know:

  1. Do you have rg or fd in your env?
  2. If you set workspace_scan_cmd = "LUA" and try it, do you see *.git entries?
joey-slingshot commented 4 weeks ago

1a. fd in my env is just my alias for find . -type d -name 1b. I do have rg (ripgrep).

  1. Setting workspace_scan_cmd = "LUA" fixed my issue. Thanks!
jsvensson commented 3 weeks ago

Just a brief +1 on this issue -- I'm using LazyVim as a base for my setup and at some point this started happening. Setting the workspace_scan_cmd worked for me too.

rizkyilhampra commented 2 weeks ago

+1 for this issue. set workspace_scan_cmd = "LUA" is worked, but it has new issue, nested .gitignore files are not respected