feat(static-commands::delete_trailing_whitespace): wire trim_trailing_whitespace into command palette#15336
Conversation
…_whitespace into command palette
| // Wrapper for trim_trailing_whitespace(). | ||
| pub fn delete_trailing_whitespace(cx: &mut Context) { | ||
| let (view, doc) = current!(cx.editor); | ||
| trim_trailing_whitespace(doc, view.id); | ||
| } |
There was a problem hiding this comment.
I would prefer trim_trailing_whitespace as the command name. The existing helper function can be renamed to trim_trailing_whitespace_impl or something similar.
|
An alternative to a new static command for this would be to add a |
…railing-whitespace
…trailing_whitespace into command palette" This reverts commit f6a8305.
Hello @the-mikedavis, thanks for the reply, sorry I took quite a break from programming. I tried it in commit 0068fb1, and it works, but I am not quite sure what I did, I just did the same thing the other TypableCommands did. I don't know:
I also wanted to tell you, that I kinda don't need this feature heavily anymore, I just wanted to learn more about helix, when I've started it. So if it is too much work, we can also let it go. But as for my part, I am still interested. Can you tell me, I will fix if needed. Thanks, |
Hi,
I suggest making
trim_trailing_whitespacea la carte.I do not see why this should not be the case, since all the infrastructure is already there.
I know there are a lot of ways to delete whitespace, and that you can set a config flag to delete it on
:w.But understand, sometimes I just fiddle with the file while thinking and it is nice to just type it in and know that the file is "clean" right now.
Like in vscode or emacs there is such a fn, I hope somebody can relate.
I ran
cargo fmt --alland served with mdbook v0.4.52, all good.