fix(autocmds): extra check that we didn't do last_loc more than once for the buffer
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user