refactor(previewer): remove with_preview_window (#2563)

This commit is contained in:
Simon Hauser
2023-06-10 21:01:23 +02:00
committed by GitHub
parent 116dbea580
commit 89ca726572
2 changed files with 59 additions and 68 deletions

View File

@@ -1,4 +1,3 @@
local context_manager = require "plenary.context_manager"
local ts_utils = require "telescope.utils"
local strings = require "plenary.strings"
local conf = require("telescope.config").values
@@ -53,18 +52,6 @@ utils.filetype_detect = function(filepath)
end
end
utils.with_preview_window = function(status, bufnr, callable)
if bufnr and vim.api.nvim_buf_call and false then
vim.api.nvim_buf_call(bufnr, callable)
else
return context_manager.with(function()
vim.cmd(string.format("noautocmd call nvim_set_current_win(%s)", status.preview_win))
coroutine.yield()
vim.cmd(string.format("noautocmd call nvim_set_current_win(%s)", status.prompt_win))
end, callable)
end
end
-- API helper functions for buffer previewer
--- Job maker for buffer previewer
utils.job_maker = function(cmd, bufnr, opts)