fdschmidt93 / telescope-egrepify.nvim

Variable user customization for telescope.live_grep to set rg flags on-the-fly
MIT License
122 stars 13 forks source link

preview problem #27

Closed kdurant closed 10 months ago

kdurant commented 11 months ago

Description

I cannot preview and open files using <C-v>, <C-t> when using search_dirs

Neovim version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1692716794

Operating system and version

Ubuntu22.04

Steps to reproduce

find_git_root = function()
    local path = vim.fn.system({ "git", "rev-parse", "--show-toplevel" })
    path = string.sub(path, 1, -2)
    if string.find(path, "fatal") then
        return nil
    else
        return path
    end
end

            {
                "fdschmidt93/telescope-egrepify.nvim",
                config = function()
                    require("telescope").setup()
                    require("telescope").load_extension("egrepify")

                    vim.keymap.set(
                        "n",
                        "<space>sw",
                        ":lua require('telescope').extensions.egrepify.egrepify({search_dirs = {require('utils').find_git_root()}})<CR>",
                        { desc = "live grep" }
                    )
                end,
            },

Expected behavior

No response

Actual behavior

As with searching in the current directory, open the file normally

Minimal config

none
fdschmidt93 commented 10 months ago

Unexpected, and AFAICT undocumented, rg behavior if opts.search_dirs is passed. Should be fixed now, let me know in case you face further issues on this!

kdurant commented 10 months ago

Thank you.