Using external editor, text added at end of note is not fed back into note

Joplin 1.3.18 (prod, win32) on Win 10.
(rest of version at bottom)

The Bug - if an external editor is used to add text at the end of a note, when the note is saved from that external editor, the changes will be lost.

There are other more obscure cases where the changes are lost, but this is the one that is easiest to reproduce.

I am using ultraedit.


<using built in note, give note a title>

Now use the arrow box to open the note in an editor - that seems to work fine:

Now add some text to the bottom:

Save the file in the editor, exit the editor, no change to the note:

Client ID: e0aebc91397147829a3999939de42292
Sync Version: 2
Profile Version: 34
Keychain Supported: Yes

Revision: 6b75485a1 (master)

I cannot replicate this issue. Since it's UltraEdit could it be a problem with the line endings? What if you set it to Linux line endings? What happens when you edit a note that already has a title and body, does it strip off the body too?

The hex screens are from UE's hex mode.

  1. It seems to work OK in notepad, but the EOL doesn't actually show there as EOL because notepad seems to expect 0d0a rather than just the 0a joplin writes out.

  2. It does NOT appear to me that the body gets stripped off, rather, changes are sometimes ignored.

  3. I have UE set to "preserve" EOL. If I write in the joplin native editor, and external edit, I get a file with EOL=0A.

  4. If I now add some text, but do NOT add a trailing EOL, UE hex will show me this, but joplin will NOT see the update after save, or even file close and STOP: So writing this back the change will NOT be recognized by joplin:

  5. If i add some EOLs and write it out again, Joplin still won't see it - as though once it's been ignored, it is ignored going forward. (Text gets ignored even though there is EOL at end.)

  6. After state 5 has been reached, edits to the note by UE are ignored by joplin. Edits with notepad seem to work.

  7. After the note has been stopped, before notepad, edits with UE still do not work.

  8. After note has been stopped, editing with notepad works, then stop, then edits with UE work, but again, if I keep adding ext at the end without an EOL, the updates will no longer be recognized.

And now, playing around with this, I get a thing where adding does NOT get picked up, but then type some more text on the same line, and eventually (maybe after more than 1 save) it DOES get picked up.

I think I would try to debug #3/#4 first, as that's the simplest repro case so far, and will hopefully shed light on the rest of what is going on.

(I dont' have build/debug working yet, and am still learning the tools, so cannot debug directly.)

If I set UE to convert to DOS - so it changes the 0A model to 0d0a and I believe will write the file back out that way (like notepad would)

Then it all seems to work.

OK, for various reasons (related to markdown and joplin!) I am trying out vs code - and I find that vsc does not have this problem. So it appears to be some thing specific to ultraedit. A sad day when I decide to kiss off ultraedit.