Remove message from whitespace removal command
This commit is contained in:
parent
d20db3486e
commit
380bb03ffd
6
init.fnl
6
init.fnl
@ -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)
|
||||||
|
Reference in New Issue
Block a user