Skip to content

Commit

Permalink
fix: make sure that prompt_win is valid bevore closing it (#2533)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conni2461 committed May 24, 2023
1 parent 109a183 commit ff8ed23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,9 @@ function Picker.close_windows(status)
utils.win_delete("preview_border_win", status.preview_border_win, true, true)

-- we cant use win_delete. We first need to close and then delete the buffer
vim.api.nvim_win_close(status.prompt_win, true)
if vim.api.nvim_win_is_valid(status.prompt_win) then
vim.api.nvim_win_close(status.prompt_win, true)
end
utils.buf_delete(status.prompt_bufnr)

state.clear_status(status.prompt_bufnr)
Expand Down

0 comments on commit ff8ed23

Please sign in to comment.