-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing Final New Line in todo.txt
#730
Comments
@nikbucher this should technically not be a big issue. I can add this in the next (pre-)release. However, why do you consider it a bug? It's not a todo.txt rule, if I am not mistaken. The todo.txt CLI is one of many todo.txt apps and I don't actually see a good reason why it would expect an empty line at the end of the file. Or am I not seeing something here? |
Hi @ransome1, thanks for your response! You're right that it's not an explicitly stated rule. However, the sample file on todotxt.org includes a final newline, and the official todo.txt CLI expects it, suggesting it might be an unofficial convention. Here are also a few technical reasons why adding a final newline to text files can be a good idea:
Adding a final newline would improve compatibility and prevent unexpected behavior when switching between sleek and the CLI. Hope this helps. Thanks a lot for the awesome sleek tool! Best regards - Nik |
@nikbucher I added this behavior to the latest RC: https://github.com/ransome1/sleek/releases/tag/v2.0.19-rc.4 I hope it does not create any unexpected side effects. Let me know if it works as expected. |
Released as part of 2.0.19: https://github.com/ransome1/sleek/releases/tag/v2.0.19 |
Thanks alot - it works great! |
The current implementation does not append a final newline character when saving the
todo.txt
file. This behavior causes issues with the standard todo.txt CLI, which expects a final newline in thetodo.txt
file. As a result, a new task added by the CLI are appended to the last task instead of being placed on a new line.Steps to Reproduce:
todo.txt
file using the current implementation.Expected Behavior:
A final newline character is added when the
todo.txt
file is saved, ensuring compatibility with the standard todo.txt CLI.Suggested Fix:
Modify the writeToFile method to ensure that a final newline character is added when writing the
todo.txt
file here:sleek/src/main/modules/File/Write.tsx
Lines 9 to 12 in c3fceea
That would be great. Thanks a lot in advance.
Best regards - Nik
The text was updated successfully, but these errors were encountered: