diff options
| author | fdschmidt93 <39233597+fdschmidt93@users.noreply.github.com> | 2021-08-23 15:27:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-23 15:27:11 +0200 |
| commit | 79dc995f820150d5de880c08e814af327ff7e965 (patch) | |
| tree | e1eeea904e97b48200a2fadcf294f1a1d2189376 /lua/telescope/actions/init.lua | |
| parent | 03c2b8f6bb8027ecdf10acc6d803886c80f99037 (diff) | |
fix: (terminal) buffer previewer (#1120)
Use existing buffers for buffer previewer to allow previewing special buffer types
Diffstat (limited to 'lua/telescope/actions/init.lua')
| -rw-r--r-- | lua/telescope/actions/init.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua index 7f82823..cda5f1d 100644 --- a/lua/telescope/actions/init.lua +++ b/lua/telescope/actions/init.lua @@ -807,6 +807,13 @@ end actions.delete_buffer = function(prompt_bufnr) local current_picker = action_state.get_current_picker(prompt_bufnr) current_picker:delete_selection(function(selection) + -- avoid preview win from closing by creating tmp buffer + local preview_win = state.get_status(prompt_bufnr).preview_win + if preview_win ~= nil and vim.api.nvim_win_is_valid(preview_win) then + local buf = vim.api.nvim_create_buf(false, true) + vim.api.nvim_buf_set_option(buf, "bufhidden", "wipe") + vim.api.nvim_win_set_buf(preview_win, buf) + end vim.api.nvim_buf_delete(selection.bufnr, { force = true }) end) end |
