Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Clicking outside telescope select window breaks all vim.ui.select actionsΒ #150

@WizardStark

Description

@WizardStark

Describe the bug
Opening a vim.ui.select window using the telescope backend and then clicking outside the popup breaks all subsequent vim.ui.select calls.

See mrjones2014/legendary.nvim#447 for original discovery of this issue and additional context

System information

  • OS: [windows/linux/mac] - all three
  • Neovim version:
$ nvim --version 
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1710088188

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"

Run :checkhealth for more info

  • Is this related to a specific vim.ui.select backend? If so, which one?
    • Telescope
  • Dressing config:
    • Provided in minimal init.lua below

To Reproduce
Steps to reproduce the behavior:

  1. vim.ui.select({ "apple", "banana" }, {}, function(item) vim.print(item) end) - mapped to <space>a for convenience
  2. triple click outside the window
  3. <space>a again, or call vim.ui.select

If possible, provide a minimal file that will trigger the issue (see
tests/manual
for examples of short ways to call vim.ui.*):

vim.g.mapleader = " "
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.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"--single-branch",
		"https://github.com/folke/lazy.nvim.git",
		lazypath,
	})
end
vim.opt.runtimepath:prepend(lazypath)

local plugins = {
	"folke/tokyonight.nvim",
	{ "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
	{ "stevearc/dressing.nvim", opts = {} },
}

require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.keymap.set("n", "<leader>a", function()
	vim.ui.select({ "apple", "banana" }, {}, function(item)
		vim.print(item)
	end)
end)

vim.opt.termguicolors = true
vim.cmd([[colorscheme tokyonight]])

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions