fix(autocmds): last_loc autocmd didn't work correctly for first opened file
This commit is contained in:
@ -32,6 +32,9 @@ vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
group = augroup("last_loc"),
|
||||
callback = function(event)
|
||||
if event.data and event.data.lazy_file then
|
||||
return
|
||||
end
|
||||
local exclude = { "gitcommit" }
|
||||
local buf = event.buf
|
||||
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then
|
||||
|
@ -168,9 +168,10 @@ function M.lazy_file()
|
||||
pattern = event.pattern,
|
||||
modeline = false,
|
||||
buffer = event.buf,
|
||||
data = event.data,
|
||||
data = { lazy_file = true },
|
||||
})
|
||||
end
|
||||
vim.api.nvim_exec_autocmds("CursorMoved", { modeline = false })
|
||||
events = {}
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user