vim: use double quotes

This commit is contained in:
Casper V. Kristensen 2024-08-25 15:38:01 +02:00
parent c0914757e5
commit 2655411b56

View file

@ -131,20 +131,20 @@
-- Restore cursor position when opening a file -- Restore cursor position when opening a file
-- https://github.com/neovim/neovim/issues/16339#issuecomment-1457394370 -- https://github.com/neovim/neovim/issues/16339#issuecomment-1457394370
vim.api.nvim_create_autocmd('BufRead', { vim.api.nvim_create_autocmd("BufRead", {
callback = function(opts) callback = function(opts)
vim.api.nvim_create_autocmd('BufWinEnter', { vim.api.nvim_create_autocmd("BufWinEnter", {
once = true, once = true,
buffer = opts.buf, buffer = opts.buf,
callback = function() callback = function()
local ft = vim.bo[opts.buf].filetype local ft = vim.bo[opts.buf].filetype
local last_known_line = vim.api.nvim_buf_get_mark(opts.buf, '"')[1] local last_known_line = vim.api.nvim_buf_get_mark(opts.buf, '"')[1]
if if
not (ft:match('commit') and ft:match('rebase')) not (ft:match("commit") and ft:match("rebase"))
and last_known_line > 1 and last_known_line > 1
and last_known_line <= vim.api.nvim_buf_line_count(opts.buf) and last_known_line <= vim.api.nvim_buf_line_count(opts.buf)
then then
vim.api.nvim_feedkeys([[g`"]], 'nx', false) vim.api.nvim_feedkeys([[g`"]], "nx", false)
end end
end, end,
}) })