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
(cherry picked from commit e54fbf4)
  • Loading branch information
rjooske authored and Conni2461 committed Mar 6, 2024
1 parent 6ee97f1 commit 199ce5f
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 @@ -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,
Expand Down

0 comments on commit 199ce5f

Please sign in to comment.