Fixed cursor restore in TrimOnSave autocmd

This commit is contained in:
2026-08-08 22:29:12 +02:00
parent e2a4b535cd
commit bc923014bb
@@ -26,7 +26,7 @@ vim.api.nvim_create_autocmd('BufWritePre', {
vim.cmd([[%s/\s\+$//e]]) -- Remove trailing whitespace on every line
vim.cmd([[%s/\n\+\%$//e]]) -- Remove all trailing blank lines
vim.fn.append(vim.fn.line('$'), '') -- Always append exactly one blank line at the end
vim.fn.setpos('.', save_cursor) -- Restore the window to where it was before the edits
vim.fn.winrestview(save_view) -- Restore the window to where it was before the edits
end,
})