TaskPaper BBEdit done box off by one error

Posted June 10, 2008 by mwiik in taskpaper bbedit bug

If I make a simple todo list in BBEdit:

Todo:

  • item 1
  • item 2

then copy and paste into TaskPaper

if I mark item 1 done, it shows the @done sign and the line thru item 2

If I make a simple todo list in Voodoopad, it works correctly.

If I copy my BBEdit text into Voodoopad and then copy and paste into Taskpaper, it exhibits the bug, as if copying and pasting directly from BBEdit. I haven't done anything unusual with BBEdit or it's preferences.

This behavior has been consistent for me on my old powerbook and new macbook pro. It's pretty much a deal breaker for me.

Any ideas on how to fix this?

jesse - June 10, 2008 2:26 PM

I think the problem is with line endings. TaskPaper expect unix style \n line endings, but BBEdit must be using something different. I'm sure there's a setting for this somewhere in BBEdit, but I'm not sure where. I hope that helps.

mwiik - June 10, 2008 2:44 PM

I know that, internally, when using regex within BBEdit, that line endings are always done with \r, even when the actual text has just newlines (\n) at the end of a line. This confused me a bit at first and I asked at the BBEdit forums and was told this was intentional.

Nonetheless, I can examine a file created by BBEdit and it shows only newlines at the end of lines.

My BBEdit preferences 'Default Line Breaks' is set to Unix (LF). There are also Mac (CR) and Windows (CRLF) options. There is a 'Translate Line Breaks' option which is set, but this applies only when opening a file with different line endings.

Just for grins, I copied text from BBedit and pasted it into a file using vi from terminal, and it still shows just a newline at the end of lines. I'm aware that paste acts different in different apps, but still curious as to why TaskPaper can't deal with what looks like a fairly simple issue. Of course, I'm just speculating here...

mwiik - June 10, 2008 2:29 PM

Me again - just tried the 2.0 development version and it continues to work strangely when dealing with copy and paste from BBEdit, but different than TaskPaper 1

Again, a simple todo composed in BBEdit and copied/pasted to TaskPaper 2

todo:

  • item 1
  • item 2

marking item one done at first puts a @done below item 1. marking it done again actually marks item 1 done and draws a line through it. This contrasts with TaskPaper 1, where it would put the @done mark and a line thru item 2 when marking item 1 done.

The 2.0 notes state 'Added Clean up line endings when reading file so that you can once again edit your files on Mac and Windows without things getting messed up.' but this is apparently still not fixed....

jesse - June 10, 2008 2:54 PM

The cleanup line endings only works when reading the file from disk, not with pasted text... though I guess I should add that too. I'll try to get a demo of bbedit and see if I can reproduce the problem. Also can you send me a zipped copy of your example todo created with BBedit. I still think it must be a line ending issue.

mwiik - June 10, 2008 3:03 PM

Check your email for the zip, although I don't see it helping any...

I would think that TextWrangler works the same way - and it's free.

One workaround is simply not to use BBEdit. TextEdit works just fine with Taskpaper

mwiik - June 10, 2008 3:06 PM

Urgh by 'not helping any' I meant that BBEdit writes files with just newline endings - nothing extra or weird.

jesse - June 10, 2008 3:27 PM

I just downloaded BBEdit and reproduced the problem. BBEdit is using \r line endings for text that's copied from it... if it saves files using \n it must be doing a translation before saving. It seems like a bit of a bug on their end, if you since it uses \r line endings for copied text even when my preference is that my file be in \n. I'll need to fix this by converting line endings on pasted text in addition to when I open files.

In the meantime I think you can workaround the problem with a tool like TextSoap. I haven't actually used it, but I'm pretty sure that it has a system service for converting line endings. Or I think there are probably other free solutions... I know I've seen them, but I can't remember any names. If anyone else knows please post links.

Topic's comments