ransome1 / sleek

todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)
https://github.com/ransome1/sleek/wiki
MIT License
1.33k stars 104 forks source link

Minor: avoid trailing spaces #488

Closed callegar closed 1 year ago

callegar commented 1 year ago

Is it an actual bug?

Yes, minor

Did you check if the bug has already been reported?

Yes

Describe the bug

When adding context or projects using the button, sleek adds a trailing space after the context/project label. When saving the task line in the todo file, if this results in a trailing space at the end of the line, the trailing space should be removed.

The trailing space is not a problem wrt the todo.txt specification. However, one of the advantages of the todo.txt format is that it is purely textual and line based, so diffs can be taken (directly or via a revision control system such as git). Trailing spaces are invisible and if present and then removed end up in spurious diffs, so they'd better be avoided beforehand.

To Reproduce Steps to reproduce the behavior:

  1. add a task, completing it with a context entry obtained by pressing a context button.
  2. check the saved todo file
  3. note a trailing space at the end of the task line

Do you see any error entries in sleeks developer tools?

N/A

Expected behavior

Would be great if sleek always saved task lines with no trailing spaces

Screenshots

N/A

Desktop (please complete the following information):

ransome1 commented 1 year ago

@callegar could you please check if this still occurs in this pre release? https://github.com/ransome1/sleek/releases/tag/v1.3.2-rc.1

callegar commented 1 year ago

Seems fine, thanks!