diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2022-05-01 09:46:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-01 09:46:50 +0200 |
| commit | 544c5ee40752ac5552595da86a62abaa39e2dfa9 (patch) | |
| tree | 5e4d6c382c9556f111df532aa5bd09ec0c398715 /lua/telescope/pickers.lua | |
| parent | 280c4e30376e54d39e760e119cbe1dde965f39d9 (diff) | |
fix: termopen previewer (#1901)
- buffer leaking
- still insert mode on confirm
Diffstat (limited to 'lua/telescope/pickers.lua')
| -rw-r--r-- | lua/telescope/pickers.lua | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index 6e8b36b..77f88f3 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -731,23 +731,15 @@ end ---@param status table: table containing information on the picker --- and associated windows. Generally obtained from `state.get_status` function Picker.close_windows(status) - local prompt_win = status.prompt_win - local results_win = status.results_win - local preview_win = status.preview_win - - local prompt_border_win = status.prompt_border_win - local results_border_win = status.results_border_win - local preview_border_win = status.preview_border_win + utils.win_delete("results_win", status.results_win, true, true) + utils.win_delete("preview_win", status.preview_win, true, true) - utils.win_delete("results_win", results_win, true, true) - utils.win_delete("preview_win", preview_win, true, true) - - utils.win_delete("prompt_border_win", prompt_border_win, true, true) - utils.win_delete("results_border_win", results_border_win, true, true) - utils.win_delete("preview_border_win", preview_border_win, true, true) + utils.win_delete("prompt_border_win", status.prompt_border_win, true, true) + utils.win_delete("results_border_win", status.results_border_win, true, true) + utils.win_delete("preview_border_win", status.preview_border_win, true, true) vim.defer_fn(function() - utils.win_delete("prompt_win", prompt_win, true) + utils.win_delete("prompt_win", status.prompt_win, true) end, 10) state.clear_status(status.prompt_bufnr) @@ -1468,6 +1460,11 @@ function pickers.on_close_prompt(prompt_bufnr) picker.close_windows(status) mappings.clear(prompt_bufnr) + vim.api.nvim_clear_autocmds { + group = "PickerInsert", + event = "BufLeave", + buffer = prompt_bufnr, + } end function pickers.on_resize_window(prompt_bufnr) |
