fix builtin.autocommands throwing error (#1758)

This commit is contained in:
Vedant Neema
2022-02-23 20:06:45 +05:30
committed by GitHub
parent df0b35c8bc
commit 567ec85b15

View File

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