Add user autocmd TelescopeFindPre (#491)

* Add user autocmd Telescope

* change name to TelescopeFindPre

* update Readme for Telescope user autocmds
This commit is contained in:
Raphael
2021-02-03 12:23:28 +08:00
committed by GitHub
parent feacafacbc
commit 779704bf26
2 changed files with 12 additions and 0 deletions

View File

@@ -520,6 +520,15 @@ Telescope find_files theme=get_dropdown
Themes should work with every `telescope.builtin` function. If you wish to
make theme, check out `lua/telescope/themes.lua`.
## Autocmds
Telescope user autocmds:
| Event | Description |
|---------------------------------|----------------------------------------------------|
| `User TelescopeFindPre` | Do it before create Telescope all the float window |
| `User TelescopePreviewerLoaded` | Do it after Telescope previewer window create |
## Extensions

View File

@@ -326,6 +326,9 @@ function Picker:find()
self.original_win_id = a.nvim_get_current_win()
-- User autocmd run it before create Telescope window
vim.cmd'do User TelescopeFindPre'
-- Create three windows:
-- 1. Prompt window
-- 2. Options window