Closed greg0ire closed 2 years ago
Several points:
Firstly and most importantly to this issue, I think adding this config option will probably be useful to other users as well. I could never account for all of the use cases that a person might have and I assume that there are file types out there that I'm unfamiliar with where white space at the end of a file is useful or necessary. I'll add a configuration option for file types to ignore in the next day or two 👍🏻
the file type being used in the video is actually a text file. The first file that is open in the bufferline is Markdown, that is true, but it isn't the one I was using. Tidy won't affect other open buffers and simply acts on the current one. I don't know if this point is really meaningful to the conversation, though, because you are right and Tidy doesn't check file type.
The guide you linked uses the example
First line with two spaces after.
And the next line.
First line with the HTML tag after.
And the next line.
which Tidy will not affect because it will not touch white space between text. I assume that you were using that example to display that white space is important to Markdown in general, so I hear you on that point, but that specific example isn't a useful one in my opinion. *If that example was being used to display that white space at the end of a Markdown file is significant, I didn't know that and that is a problem.* I've never run into that issue before, though. Here is a GIF displaying Tidy working on a Markdown file populated with this example:
![tidy_md](https://user-images.githubusercontent.com/59481467/173189657-d612ab47-cf38-4be6-87e6-8f8979eb9491.gif)
First line with two spaces after. <-- here
. In the example, the second part with the <br/>
is html generated from the first part, which is markdown, and the <br/>
is generated from the two spaces.
If that example was being used to display that white space at the end of a Markdown file is significant, I didn't know that and that is a problem.
Yes, this is what the example is all about.
I found some online markdown processors, and only this one implements it, and for one space, not 2: https://markdown.pioul.fr So the issue is very minor, but still, I can imagine how spaces might be important in other languages I don't know. It is for sure a problem for https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29 :laughing:
I misunderstood! I thought you were talking about lines at the end of the file but I understand now. Because the syntax guide indicates that this is one the portable methods for creating line breaks, this should definitely be a case that is taken care of.
I will implement this soon
Thanks!
No problem, happy to help!
Hi! I'm trying to migrate my vim config to lua, and stumbled upon this plugin, which looks great, except for one thing: it uses Markdown as an example for the main usage, and Markdown is the only file format I know for which trailing whitespace is meaningful. I don't use it and no longer work with people who do so I'm still going to use your plugin, but still, it would be nice to be able to disable this plugin for markdown only.