Bizarre behavior when carriage return in editor window

Ed's Avatar


05 Apr, 2019 09:58 PM

Just updated to latest version 4.5.6 (93), and I'm editing a markdown document, and the **editor window** is displaying this strange behavior. When I hit 'return' at the end of a line (or beginning of next line) the last character or 2 drops down onto the new line, though the editor doesn't appear to 'see' this as separate from the characters before it. For instance, if I back up a character and hit delete, the previous character is erased (not the line break). I'm attaching 3 images, because it's hard to describe. Basically image 1 is time 1, before hitting 'return.' Then image 2 is after hitting return once, and image 3 is after hitting return a second time.

  1. Support Staff 1 Posted by Fletcher on 05 Apr, 2019 11:54 PM

    Fletcher's Avatar


    Thanks for letting me know. Can you send me the file that this happens in so I can track down what’s happening? I have an idea but need a way to reproduce the exact circumstances in order to fix it.



    Sent from my iPhone

  2. 2 Posted by Mike Apgar on 06 Apr, 2019 02:44 AM

    Mike Apgar's Avatar

    Same issue, file attached.

  3. Support Staff 3 Posted by Fletcher on 06 Apr, 2019 04:45 PM

    Fletcher's Avatar


    Is there a certain thing I have to do to trigger the issue that you have figured out? I can't get the problem to occur when hitting return at various places in the document.

    If it happens all the time for you, can you attach screenshots of your preferences so I can use the same settings? Maybe that will help me reproduce and fix.



  4. Support Staff 4 Posted by Fletcher on 06 Apr, 2019 06:11 PM

    Fletcher's Avatar

    Never mind -- the file downloaded without proper encoding, which converted the file to ASCII. Once I got it in proper encoding, I can replicate the issue. Will fix and submit update ASAP. Unfortunately I am out of town, so probably can't submit to App Store on Tuesday. We'll see if I can do something sooner.

    Thanks for the file!!!

  5. Support Staff 5 Posted by Fletcher on 07 Apr, 2019 02:47 PM

    Fletcher's Avatar

    I think it’s caused by a 4 byte multibyte character. I had to recode some byte to character offset conversion routines from C to Objective-C in order to improve performance on long files. Apparently I missed an edge case. I’ll fix and use all the tests from my C code.

  6. Support Staff 6 Posted by Fletcher on 07 Apr, 2019 11:07 PM

    Fletcher's Avatar

    Figured it out -- I misunderstood some of the nuances of UTF-16 encoding, after working predominantly with UFT-8 encoding for years. I updated the conversion routines I need, and have a more detailed test suite.

    I'll push a new update to Apple Tuesday.

    Thanks again for the example to help me track this down!

  7. Support Staff 7 Posted by Fletcher on 09 Apr, 2019 04:09 AM

    Fletcher's Avatar

    A new version has been submitted to Apple that fixes this issue in my tests.

    Thanks again!


  8. Fletcher closed this discussion on 09 Apr, 2019 04:09 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac