fix(autocmds): jump to last loc in buffer (#1061)

vim.api.nvim_win_set_cursor is expecting a window handle but was being
passed the current buffer's handle instead
This commit is contained in:
Sam Amis 2023-07-06 08:43:15 -05:00 committed by GitHub
parent b660b51718
commit baa9614022
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ vim.api.nvim_create_autocmd("BufReadPost", {
local mark = vim.api.nvim_buf_get_mark(buf, '"')
local lcount = vim.api.nvim_buf_line_count(buf)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, buf, mark)
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})