nvim-telescope / telescope.nvim

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

Autocomplete menu of `builtin.diagnostics()` still hangs there after closing telescope #1675

Closed rockyzhang24 closed 2 years ago

rockyzhang24 commented 2 years ago

Description

In builin.diagnostics() picker, press <C-l> to open the autocomplete menu for filtering the results by diagnostic type, however, without selecting any type, I press <C-c> to close telescope, this autocomplete menu will be hanging there forever.

UPDATE: Just now I tested builtin.lsp_document_symbols() picker and it has the same issue. It seems that this issue exists on all pickers that support the autocomplete menu.

Neovim version

NVIM v0.7.0-dev+797-gb218d02c4
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by rockyzhang@mbp2021

Operating system and version

macOS 12.1 (the latest)

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

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

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

Steps to reproduce

In a buffer with some diagnostics:

  1. open the builtin.diagnostics() picker
  2. press <C-l>, the autocomplete menu will popup
  3. don't select any entry, press <C-c> to close telescope

You can see that the autocomplete menu won't be closed.

Expected behavior

The autocomplete menu should be closed after the diagnostic picker is closed

Actual behavior

https://user-images.githubusercontent.com/11582667/148841995-1b62e4be-4214-410b-9912-9750c8375764.mov

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',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    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()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
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()]]
fdschmidt93 commented 2 years ago

Just tried and doesn't happen for me on neovim master. Should this issue persist, please open a new issue with an actual minimal init lua.