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

Unrelated search result list briefly showing up while typing #3342

Open
opsidjflksdf opened this issue Oct 27, 2024 · 2 comments
Open

Unrelated search result list briefly showing up while typing #3342

opsidjflksdf opened this issue Oct 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@opsidjflksdf
Copy link

opsidjflksdf commented Oct 27, 2024

Description

This is with Telescope files, observing the behavior with whether with fzf-native installed or not (defaulting to fzy-lua). With the default fzy - its easier to notice as the intermediary results linger for longer.

Say I'll start typing in the prompt, and after the first couple of letters I have a result list. Then I'll type two more letters quickly one after the other, and as soon I'm done typing them, the list changes to some kind of an intermediary result list of items that looks completely unrelated to the results to that point (as opposed to, say, a refinement of that list). That only shows briefly, and after that the "correct"/final list of results as expected, are shown, without me typing anything else after the last two letters.
If I type the last two letters with some pause in between them, I don't observe this effect, the results for each keystroke change without brief flashes of "intermediary results".
Just to clarify, this is not a case of the intermediary results being the ones resulting from to the first keystroke of the two, and being delayed. That is a different set (natural refinement) than the unrelated ones that that flash.
So it looks like Telescope is programmed to retrieve a first set of results through what is presumably a quicker operation, in order to have something to display initially, but after that it will still wait for a better but slower set of results and once it gets them it updates the list in front of you.
This in a nutshell is what happens at detailed level, the problem is that this compounds as you are typing longer inputs quickly and you get the list changing itself all over the place and you see flashes of unrelated results as you type. Makes it unpleasant to even look at the results shaping up, you just want to look away.
I don't see this with fzf-lua.nvim or with fzf.vim - the results are smoothly and naturally refining themselves as you type in the input.

This of course doesn't happen with just any file hierarchy or any search input. You have to have a hierarchy of files substantial enough (though not anything overwhelming), and try a couple of combinations to see it.
I don't see it for example with Telescope buffers, where i only have 5-10 buffers open.

I'm sure this must be known behavior, I can't figure how to search for it though in the discussions, could someone point me to any discussion on the history/background and possible workarounds/settings to alleviate it? Feel free to mark this as a duplicate of an existing bug report.
I'm trying to look at the source code in the meantime.
Thank you a bunch!

Neovim version

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

Operating system and version

Windows 10, Linux Ubuntu 24.04.1 LTS

Telescope version / branch / rev

0.1.x

checkhealth telescope

telescope: health#telescope#check

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

Checking external dependencies ~
- OK rg: found ripgrep 14.1.1 (rev 4649aa9700)
- OK fd: found fd 10.1.0

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

Telescope Extension: `file_browser` ~
- No healthcheck provided

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

Telescope Extension: `json_history` ~
- No healthcheck provide

Steps to reproduce

Please see bug description.

Expected behavior

Expecting not to see "intermediary" results at all

Actual behavior

Seeing intermediary results flashing briefly

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",
})
@opsidjflksdf opsidjflksdf added the bug Something isn't working label Oct 27, 2024
@asilvadesigns
Copy link

I'm seeing this as well, it seemed like flickering at first but I have noticed fzf-lua doesn't do this, neither do I have any odd settings in my config.

@opsidjflksdf
Copy link
Author

Verified that I get the same behavior on Linux as well - I updated the ticket.

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