fix COMMIT_EDITMSG last location
This commit is contained in:
1 parent
cd5fe93ca9
commit
772a838cf6
1 file changed
+12
-8
@@ -22,16 +22,20 @@ local utils = require("darcula.utils")
|
|||||||
local group =
|
local group =
|
||||||
utils.augroup_with_autocmd(
|
utils.augroup_with_autocmd(
|
||||||
"DarculaAutoCommands",
|
"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('\'"')
|
local pos = vim.fn.line('\'"')
|
||||||
if
|
if pos >= 1 and pos <= vim.fn.line("$") then
|
||||||
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
|
|
||||||
vim.cmd('normal! g`"')
|
vim.cmd('normal! g`"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user