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

Telescope takes ages to close #3159

Open
Mango0x45 opened this issue Jun 9, 2024 · 2 comments
Open

Telescope takes ages to close #3159

Mango0x45 opened this issue Jun 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Mango0x45
Copy link

Mango0x45 commented Jun 9, 2024

Description

I am using telescope, and have <Esc> mapped to close telescope when I’m in insert mode. This works… but for whatever reason this has a very noticable delay (1 full second) in a very specific directory of mine which contains… a few 100 lines of C code.

I have tested and confirmed that this has nothing to do with LSP or TreeSitter (I tried with :LspStop and :TSBufDisable <options>). I also checked my mappings with :map <Esc> and confirmed that I only have a single mapping, but that mapping is in normal mode (I am in insert mode), and even without it the delay persists.

I am at a total loss as to how to further debug this.

Neovim version

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1716656478

Operating system and version

Arch Linux

Telescope version / branch / rev

commit 3a74349

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 14.1.0
- OK fd: found fd 10.1.0

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

Steps to reproduce

local telescope = require 'telescope'
local actions = require 'telescope.actions'

telescope.setup {
	defaults = {
		mappings = {
			i = {
				['<Esc>'] = {
					actions.close,
					type = 'action',
					opts = { nowait = true, silent = true },
				},
			},
		},
	},
}

Then I just do :Telescope find_files (or really any picker), and hit <Esc>.

Expected behavior

The picker to close instantly.

Actual behavior

The picker takes over a second.

Minimal config

(The issue also persists when using simply this 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' },
        },
      },
    },
    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 = {
      mappings = {
        i = {
          ['<Esc>'] = {
            require('telescope.actions').close,
            type = 'action',
            opts = { nowait = true, silent = true },
          },
        },
      },
    },
  })
  require('telescope').load_extension('fzf')
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()]]
@Mango0x45 Mango0x45 added the bug Something isn't working label Jun 9, 2024
@jamestrew
Copy link
Contributor

This only happens in one specific directory?

I'm not able to reproduce this and I'm not sure what could even be causing it especially without being able to reproduce it.

@Mango0x45
Copy link
Author

This only happens in one specific directory?

I'm not able to reproduce this and I'm not sure what could even be causing it especially without being able to reproduce it.

Yes, but I also only started using telescope today. I can try to copy my files to a different directory and see if the issue still persists in the copy.
If it does, I can upload a tarball of the directory to see if others can reproduce the issue

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

No branches or pull requests

2 participants