Closed benrhughes closed 10 years ago
I'd like to work on this feature. I'm guessing the intent is to allow for a file with Unix-style line endings to retain those line endings after Todotxt.net has worked with it. Is that right?
I think it might be necessary to replace calls of File.WriteAllLines
with another method, to avoid having to use Environment.Newline
to separate lines.
No matter what, it would be necessary to determine what type of line endings are used in the file, either by adding a new utility class or adding a private method to TaskList.cs. That should be easy enough to implement, though it would add some I/O cycles each time the file is read.
Are you looking for a "preserve Unix line endings" option? Todo.txt on iOS handles this automatically, which is my preference, but the I/O hit on large files might be more than you want to add to your app.
Thanks for taking a look.
I'd prefer it to work automatically, as the iOS app does. I don't mind taking the I/O hit, which hopefully shouldn't be too bad.
Cheers,
Ben
On Thu, Mar 6, 2014 at 8:42 AM, mjdescy notifications@github.com wrote:
I'd like to work on this feature. I'm guessing the intent is to allow for a file with Unix-style line endings to retain those line endings after Todotxt.net has worked with it. Is that right?
I think it might be necessary to replace calls of File.WriteAllLines with another method, to avoid having to use Environment.Newline to separate lines.
No matter what, it would be necessary to determine what type of line endings are used in the file, either by adding a new utility class or adding a private method to TaskList.cs. That should be easy enough to implement, though it would add some I/O cycles each time the file is read.
Are you looking for a "preserve Unix line endings" option? Todo.txt on iOS handles this automatically, which is my preference, but the I/O hit on large files might be more than you want to add to your app.
Reply to this email directly or view it on GitHubhttps://github.com/benrhughes/todotxt.net/issues/166#issuecomment-36797621 .
When writing to todo.txt, use the existing line endings.