Preserve registers when deleting whitespace at EOF

I wanted to move some code from one file to another, but when I saved the register was overridden with the whitespace.
main
Marius 2 years ago committed by GitHub
parent 4dcb51102e
commit 093c9f0f73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -59,7 +59,7 @@ function M.setup(opts)
vim.cmd([[:keepjumps keeppatterns %s/\s\+$//e]])
-- delete lines @ eof
vim.cmd([[:keepjumps keeppatterns silent! 0;/^\%(\n*.\)\@!/,$d]])
vim.cmd([[:keepjumps keeppatterns silent! 0;/^\%(\n*.\)\@!/,$d_]])
reset_cursor_pos(cursor_pos)
end,

Loading…
Cancel
Save