Invalid 'event': 'User TelescopeResumePost'
mimre25 opened this issue · 1 comments
mimre25 commented
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,
})
Conni2461 commented
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