Commit 861ad5e
Fix/noeol (todotxt#295)
* Handle missing EOL in todo.txt
This can happen easily with certain editors (such as Mousepad) that do not automatically add a newline character at the end of a file.
In _addto(), ensure a trailing newline via sed (taken from https://unix.stackexchange.com/a/31955/18876).
Fixes todotxt#294
* Tests: Add basic coverage of move
* Handle missing EOL in todo.txt for move, too
This can happen easily with certain editors (such as Mousepad) that do not automatically add a newline character at the end of a file.
* Refactoring: Extract fixMissingEndOfLine()
* FIX: Compatibility: sed \+ multi not supported on MacOS
Use the POSIX \{1,\} instead.
Co-authored-by: Ali Karbassi <[email protected]>1 parent 13b451b commit 861ad5e
3 files changed
+95
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
113 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
469 | 475 | | |
470 | 476 | | |
471 | 477 | | |
| |||
809 | 815 | | |
810 | 816 | | |
811 | 817 | | |
| 818 | + | |
812 | 819 | | |
813 | 820 | | |
814 | 821 | | |
| |||
1339 | 1346 | | |
1340 | 1347 | | |
1341 | 1348 | | |
| 1349 | + | |
1342 | 1350 | | |
1343 | 1351 | | |
1344 | 1352 | | |
| |||
0 commit comments