From 5d44c976a746e29cfe52ceab93dd3de5db2eafa8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 9 Oct 2023 20:11:05 +0200 Subject: [PATCH] fix(autocmds): extra check that we didn't do last_loc more than once for the buffer --- lua/lazyvim/config/autocmds.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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