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

send_all_to_qf does not append to prompt history #2382

Closed
ivanbrennan opened this issue Feb 14, 2023 · 0 comments · Fixed by #2527
Closed

send_all_to_qf does not append to prompt history #2382

ivanbrennan opened this issue Feb 14, 2023 · 0 comments · Fixed by #2527
Labels
bug Something isn't working

Comments

@ivanbrennan
Copy link

Description

Calling actions.send_all_to_qf() (bound to <C-q> by default) does not append the current query to prompt history. As a result, on a subsequent invocation of the same picker, you cannot recall the previous query via actions.cycle_history_prev().

Neovim version

NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by nixbld

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/zfyninsb38hzxkx3rxvwz3lxdxnsfz0j-neovim-unwrapped-0.8.1/share/nvim
"

Operating system and version

NixOS 23.05pre435935.04f574a1c0f (Stoat)

Telescope version / branch / rev

cabf991

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.6.0

## ===== Installed extensions =====

## Telescope Extension: `file_browser`
  - INFO: No healthcheck provided

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

## Telescope Extension: `undo`
  - INFO: No healthcheck provided

Steps to reproduce

  1. echo abc > abc.txt
  2. nvim -nu minimal.lua
  3. :lua require('telescope.builtin').live_grep()
  4. insert ab
  5. hit <CR> to visit currently-selected result
  6. :lua require('telescope.builtin').live_grep()
  7. insert bc
  8. hit <C-q> to send results to quickfix
  9. :lua require('telescope.builtin').live_grep()
  10. hit <M-p> to recall previous query from history via actions.cycle_history_prev()

Expected behavior

The most recent query (bc) is inserted at the prompt.

Actual behavior

An older query (ab) is inserted at the prompt.

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
        },
      },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup({
    defaults = {
      history = { limit = 1000 },
      mappings = {
        i = {
          ["<M-p>"] = require('telescope.actions').cycle_history_prev,
        },
      },
    },
  })
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant