From 093c9f0f733c9ac99a4ee308a425491ab8b643b4 Mon Sep 17 00:00:00 2001 From: Marius <5224719+kmarius@users.noreply.github.com> Date: Sat, 17 Sep 2022 20:22:37 +0200 Subject: [PATCH] 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. --- lua/tidy/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/tidy/init.lua b/lua/tidy/init.lua index 7f81237..a2bc336 100644 --- a/lua/tidy/init.lua +++ b/lua/tidy/init.lua @@ -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,