mcauley-penney / tidy.nvim

A small Neovim plugin to remove trailing whitespace and empty lines at end of file on every save
107 stars 15 forks source link

Use a more realistic example #6

Closed greg0ire closed 2 years ago

greg0ire commented 2 years ago

Today, I found that this plugin breaks patch files.

mcauley-penney commented 2 years ago

Thank you for this, this is much better!

mcauley-penney commented 2 years ago

On another topic, I have been considering some configuration options lately. The first one in mind is allowing the user to define an amount of spaces to leave at the end of a line on a per-filetype basis. For example, a user may choose to leave two spaces at the end of a line if the spaces exist but remove all the rest down to two spaces (if there are five spaces, they are reduced down to two). What do you think?

greg0ire commented 2 years ago

I think it would make sense for markdown 👍, maybe there are more formats that would benefit from this, but I don't know which. Not for diff I think, because it would corrupt a patch which means to patch a file with trailing spaces.

mcauley-penney commented 2 years ago

Of course, I think my question was off-topic for the diff filetype but I wanted to get your opinion while we were already speaking. I may include both diff and markdown as default ignored filetypes.