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

This commit is contained in:
rjooske
2024-01-30 03:11:46 +09:00
committed by GitHub
parent 2f3857c25b
commit e54fbf4ab2

View File

@@ -579,7 +579,10 @@ previewers.vimgrep = defaulter(function(opts)
if entry.bufnr and (p == "[No Name]" or has_buftype) then if entry.bufnr and (p == "[No Name]" or has_buftype) then
local lines = vim.api.nvim_buf_get_lines(entry.bufnr, 0, -1, false) 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) vim.api.nvim_buf_set_lines(self.state.bufnr, 0, -1, false, lines)
-- 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) jump_to_line(self, self.state.bufnr, entry)
end)
else else
conf.buffer_previewer_maker(p, self.state.bufnr, { conf.buffer_previewer_maker(p, self.state.bufnr, {
bufname = self.state.bufname, bufname = self.state.bufname,