Remove message from whitespace removal command

This commit is contained in:
Alexander Rosenberg 2022-12-13 08:42:48 -08:00
parent d20db3486e
commit 380bb03ffd
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -61,10 +61,8 @@
;; Remove trailing whitespace ;; Remove trailing whitespace
(fn remove-trailing-whitespace [] (fn remove-trailing-whitespace []
"Remove trailing whitespace from the whole file." "Remove trailing whitespace from the whole file."
(let [res (pcall vim.cmd "%s/ \\+$//")] (pcall vim.cmd "%s/ \\+$//")
(vim.cmd.nohlsearch) (vim.cmd.nohlsearch))
(when (not res)
(print "File is clean"))))
(vim.api.nvim_create_user_command :RemoveTrailingWhitespace (vim.api.nvim_create_user_command :RemoveTrailingWhitespace
remove-trailing-whitespace {}) remove-trailing-whitespace {})
(hook! [ :BufWritePre ] "*" remove-trailing-whitespace) (hook! [ :BufWritePre ] "*" remove-trailing-whitespace)