Skip to content

Commit

Permalink
fix(previewer): buffer previews for term not initially scrolled (#2899)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjooske committed Jan 29, 2024
1 parent 2f3857c commit e54fbf4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/telescope/previewers/buffer_previewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,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)
-- 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)
end)
else
conf.buffer_previewer_maker(p, self.state.bufnr, {
bufname = self.state.bufname,
Expand Down

0 comments on commit e54fbf4

Please sign in to comment.