nvim-telescope/telescope.nvim

Jump to character forwards and backwards is delayed

tpintaric opened this issue · 13 comments

Description

When telescope plugin is added to the clean neovim config and afterwards mappings added, there is a strange delay when you want to use vim motions to jump to the next character with "f" and "t" functions.
There may be 2 seconds delay between repetitive jumps.

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1713773202

Operating system and version

Arch linux

Telescope version / branch / rev

0.1.4

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 9.0.0

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

Telescope Extension: `notify` ~
- No healthcheck provided

Steps to reproduce

  • Added Telescope to lazy .lua file in ~/.config/nvim/lua/plugins/telescope.lua
  • Added startup config to after file in ~/.config/nvim/after/plugin/telescope.lua with content:
require('telescope').setup()

Expected behavior

Before Telescope gets introduced, jumping to characters backwords and forwards works without any delay using f t F T vim normal mode keys.

Actual behavior

After Telescope there are delays when performing these jumps.

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()]]

I can pretty much guarantee this has nothing to do with telescope.
I've never experienced this, nor heard of any prior issues from anyone like this. Feels like an issue with overlapping keymappings.
You can try :nmap t and see if there's some mapping there you're not expecting.

If you find nothing, then please try the minimal config.
You can save it to some temp folder as minimal.lua and then use nvim -nu minimal.lua to launch neovim (usually takes 2 tries for me to install everything and get things working).
You can use this minimal config to try to replicate this issue.

I stand corrected. When telescope mappings are not used, jumping to characters works. Even with minimal telescope file as soon as I try and map using telescope local builtin = require('telescope.builtin') this delay is evident. I can demo this to you but not sure which utility to use.

Can you show me the new minimal config you're using to reproduce this? I'll try on my end as well.

vim.g.mapleader = ";"
vim.g.maplocalleader = ";"
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()]]
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})

Just added mappings below

Just to confirm, you're having issues with f/F/t/T regular vim motions being delayed in a regular buffers with telescope installed?

I'm not experiencing any delays with your modified config

char-search.mp4

Must be something on my end then, not sure what else to try, could demo it.

Out of curiosity, which OS you running ?

Also arch linux

Glad you were able to figure it out 😄