fix(previewer): buffer previews for term not initially scrolled (#2899)

(cherry picked from commit e54fbf4ab2)
This commit is contained in:
rjooske
2024-01-30 03:11:46 +09:00
committed by Simon Hauser
parent 6ee97f1f8b
commit 199ce5fc25
@@ -486,7 +486,10 @@ previewers.vimgrep = defaulter(function(opts)
if entry.bufnr and (p == "[No Name]" or has_buftype) then
local lines = vim.api.nvim_buf_get_lines(entry.bufnr, 0, -1, false)
vim.api.nvim_buf_set_lines(self.state.bufnr, 0, -1, false, lines)
jump_to_line(self, self.state.bufnr, entry.lnum)
-- schedule so that the lines are actually there and can be jumped onto when we call jump_to_line
vim.schedule(function()
jump_to_line(self, self.state.bufnr, entry.lnum)
end)
else
conf.buffer_previewer_maker(p, self.state.bufnr, {
bufname = self.state.bufname,