fix: builtin autocommands previewer throws error (#1732)

This commit is contained in:
daangoossens22
2022-02-14 17:36:55 +01:00
committed by GitHub
parent 88229d5afd
commit c948263d89

View File

@@ -930,7 +930,11 @@ previewers.autocommands = defaulter(function(_)
end
vim.api.nvim_buf_add_highlight(self.state.bufnr, ns_previewer, "TelescopePreviewLine", selected_row + 1, 0, -1)
-- set the cursor position after self.state.bufnr is connected to the
-- preview window (which is scheduled in new_buffer_previewer)
vim.schedule(function()
vim.api.nvim_win_set_cursor(status.preview_win, { selected_row, 0 })
end)
self.state.last_set_bufnr = self.state.bufnr
end,