nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
MIT License
15.96k stars 838 forks source link

send_to_qflist is opening the quickfix list #3285

Closed tbtonner closed 1 month ago

tbtonner commented 2 months ago

Description

I remapped ["<C-q>"] = actions.send_to_qflist from ["<C-q>"] = actions.send_to_qflist + actions.open_qflist but the behaviour was the same whether open_qflist was there or not.

I expected this to result in the quickfix list not opening upon pressing C-q

Neovim version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478
Run "nvim -V1 -v" for more info

Operating system and version

macOS 14.6.1

Telescope version / branch / rev

3b1600d0fd5172ad9fae00987362ca0ef3d8895d

checkhealth telescope

==============================================================================
telescope: require("telescope.health").check()

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

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- OK fd: found fd 8.5.2

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

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

Steps to reproduce

Set

require('telescope').setup {
    defaults = {
        file_ignore_patterns = {
            "mocks",
        },
        mappings = {
            i = { ["<C-q>"] = actions.send_to_qflist },
        },
    },
}

And open a grep and press C-q - the quickfix list opens automatically.

Expected behavior

Opening a grep and pressing C-q would close the window and not open the quickfix list.

Actual behavior

It's opened automatically.

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 {}
    end,
  },
}

require("lazy").setup(plugins, {
  root = root .. "/plugins",
})
jamestrew commented 1 month ago

https://github.com/user-attachments/assets/0df1d374-c964-476f-8c49-28078ad26df9

I'm not able to reproduce this. Please try with the minimal config.