From 18749407bfa6a8c5b4921705f992f5465736974d Mon Sep 17 00:00:00 2001 From: tdback Date: Fri, 17 Jan 2025 20:12:52 -0500 Subject: fix: avoid restoring cursor in git commit buffers --- plugin/autocmd.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugin') diff --git a/plugin/autocmd.lua b/plugin/autocmd.lua index 1597a21..ee96371 100644 --- a/plugin/autocmd.lua +++ b/plugin/autocmd.lua @@ -22,6 +22,9 @@ autocmd({ "BufWritePre" }, { -- Restore cursor's position in buffer from previous session. autocmd({ "BufReadPost" }, { callback = function(args) + if vim.bo.filetype == "gitcommit" then + return + end local mark = vim.api.nvim_buf_get_mark(args.buf, '"') local count = vim.api.nvim_buf_line_count(args.buf) if mark[1] > 0 and mark[1] <= count then -- cgit v1.2.3