fix(autocmds): jump to last loc in buffer

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-05 18:30:49 +01:00
parent 0b020dc37b
commit 967ab1965d
No known key found for this signature in database
GPG key ID: 597FE84E3179C8FB

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,
})