fix: revert buffers previewer (#1400)

* Reverts #1120 many issues arise (mru, highlighting, settings inheritance, ...) when previewing actual buffers
This commit is contained in:
fdschmidt93
2021-11-04 07:55:32 +01:00
committed by GitHub
parent 2097f11305
commit 97842abb03
5 changed files with 19 additions and 127 deletions

View File

@@ -831,13 +831,6 @@ 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