diff --git a/home/private_dot_config/nvim/lua/settings.lua b/home/private_dot_config/nvim/lua/settings.lua index 0ff1dac..7bd1225 100644 --- a/home/private_dot_config/nvim/lua/settings.lua +++ b/home/private_dot_config/nvim/lua/settings.lua @@ -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, })