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

Builtin buffer picker highlights flags column when searching #3240

Open
bedlamzd opened this issue Aug 7, 2024 · 4 comments
Open

Builtin buffer picker highlights flags column when searching #3240

bedlamzd opened this issue Aug 7, 2024 · 4 comments
Labels
bug Something isn't working reproducible Bug that can be reproduced.

Comments

@bedlamzd
Copy link

bedlamzd commented Aug 7, 2024

Description

When searching for a symbol that appears both in flags column and filename, highlight applies to the former. Appears to be because it finds this symbol first.

At first I thought that flags are searchable (and I would love that) but after some investigation found out this bug

Neovim version

NVIM v0.10.1
Build type: RelWithDebInfo
LuaJIT 2.1.1720049189

Operating system and version

fedora 40 (under WSL)

Telescope version / branch / rev

3b1600d

checkhealth telescope

──────────────────────────────────────────────────────────────────────────────
telescope: require("telescope.health").check()
                                                                                                                    
Checking for required plugins
- OK plenary installed.
- WARNING nvim-treesitter not found. (Required for `:Telescope treesitter`.)
                                                                                                                    
Checking external dependencies
- OK rg: found ripgrep 14.1.0
- WARNING fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities
                                                                                                                    
===== Installed extensions =====

Steps to reproduce

  1. create multiple files with "h" in the name
  2. inside neovim open the files so that they become hidden buffers
  3. open buffers picker with :lua require("telescope.builtin").buffers()
  4. try to search for a string that starts with "h"

Expected behavior

Highlight applies to filename only like that:
image

Actual behavior

Here I have some hidden buffers:
image

When I type "h" that is present in file names:
image

Weirdly when typing more behavior differs between entries:
image

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",
})
@bedlamzd bedlamzd added the bug Something isn't working label Aug 7, 2024
@Tal500

This comment has been minimized.

@jamestrew
Copy link
Contributor

I'm able to reproduce this but this would probably be tricky to fix.

@Tal500 seems unrelated. #3192 is only specific to the git status picker.

@jamestrew jamestrew added the reproducible Bug that can be reproduced. label Aug 11, 2024
@Tal500

This comment has been minimized.

@Tal500

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working reproducible Bug that can be reproduced.
Projects
None yet
Development

No branches or pull requests

3 participants