fix COMMIT_EDITMSG last location

This commit is contained in:
sgraves committed 2026-08-31 20:53:11 +00:00
1 parent cd5fe93ca9
commit 772a838cf6
1 file changed
+12 -8
+12 -8
View File
@@ -22,16 +22,20 @@ local utils = require("darcula.utils")
local group =
utils.augroup_with_autocmd(
"DarculaAutoCommands",
"BufReadPost",
"BufWinEnter",
"*",
function()
function(args)
local bufnr = args.buf
if vim.b[bufnr]._darcula_cursor_restored then
return
end
vim.b[bufnr]._darcula_cursor_restored = true
local ft = vim.bo[bufnr].filetype
if ft == "commit" or ft == "fugitive" or ft == "gitcommit" or ft == "rebase" then
return
end
local pos = vim.fn.line('\'"')
if
pos >= 1 and pos <= vim.fn.line("$") and vim.bo.filetype ~= "commit" and
vim.bo.filetype ~= "gitcommit" and
vim.bo.filetype ~= "fugitive" and
vim.bo.filetype ~= "rebase"
then
if pos >= 1 and pos <= vim.fn.line("$") then
vim.cmd('normal! g`"')
end
end