diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 7d9feedd..9f4344cf 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -34,9 +34,10 @@ vim.api.nvim_create_autocmd("BufReadPost", { callback = function(event) local exclude = { "gitcommit" } local buf = event.buf - if vim.tbl_contains(exclude, vim.bo[buf].filetype) then + if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then return end + vim.b[buf].lazyvim_last_loc = true 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