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

Invalid 'event': 'User TelescopeResumePost' #3094

Closed
mimre25 opened this issue May 11, 2024 · 1 comment
Closed

Invalid 'event': 'User TelescopeResumePost' #3094

mimre25 opened this issue May 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mimre25
Copy link

mimre25 commented May 11, 2024

Description

I'm trying to set up an autocmd based on one of the events that telescope triggers, but I'm running into Invalid 'event': 'User TelescopeResumePost' no matter which event I pick.

Neovim version

NVIM v0.9.5
Build type: RelWithDebInfo
LuaJIT 2.1.1692716794
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/home/martin/Tools/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/martin/Tools/neovim/.deps/usr/include -I/home/martin/Tools/neovim/build/src/nvim/auto -I/home/martin/Tools/neovim/build/include -I/home/martin/Tools/neovim/build/cmake.config -I/home/martin/Tools/neovim/src -I/usr/include -I/home/martin/Tools/neovim/.deps/usr/include -I/home/martin/Tools/neovim/.deps/usr/include -I/home/martin/Tools/neovim/.deps/usr/include -I/home/martin/Tools/neovim/.deps/usr/include -I/home/martin/Tools/neovim/.deps/usr/include -I/home/martin/Tools/neovim/.deps/usr/include

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info

Operating system and version

Ubuntu 20.04

Telescope version / branch / rev

telescope 0.1.x

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 11.0.2
- OK fd: found fd 7.4.0

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

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

Telescope Extension: `laravel` ~
- No healthcheck provided

Telescope Extension: `tmux` ~
- No healthcheck provided


### Steps to reproduce

Add
```lua
vim.api.nvim_create_autocmd('User TelescopeResumePost', {
  once = true,
  callback = function()
    print('User TelescopeResumePost works')
  end,
})

to your config.

Expected behavior

The autocmd should register

Actual behavior

Invalid 'event': 'User TelescopeResumePost'

Minimal config

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	{
		"nvim-telescope/telescope.nvim",
		branch = "0.1.x",
		dependencies = { "nvim-lua/plenary.nvim" },
	},
})
local telescope = require("telescope")

telescope.setup({})

vim.api.nvim_create_autocmd('User TelescopeResumePost', {
  once = true,
  callback = function()
    print('User TelescopeResumePost works')
  end,
})
@mimre25 mimre25 added the bug Something isn't working label May 11, 2024
@Conni2461
Copy link
Member

sorry but thats not a telescope issue but rather an issue with your code.

the correct code is as follows

vim.api.nvim_create_autocmd("User", {
  pattern = "TelescopeResumePost",
  once = true,
  callback = function()
    print('User TelescopeResumePost works')
  end,
})

we also have an example for user autocmds here in this section https://github.com/nvim-telescope/telescope.nvim?tab=readme-ov-file#previewers

@Conni2461 Conni2461 closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
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