nvim: add variable to prevent file cleanups

This commit is contained in:
tastytea 2022-12-20 04:59:28 +01:00
parent 9b421d742f
commit 2ace21d1f6
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM

View File

@ -8,6 +8,9 @@ function M.map(mode, shortcut, command, description, buffer)
end
function M.remove_trailing_whitespace()
if vim.b.cleanup_file == false then
return
end
local curpos = vim.api.nvim_win_get_cursor(0)
vim.cmd([[keeppatterns %s/\s\+$//e]])
vim.api.nvim_win_set_cursor(0, curpos)