Menu

#2501 Document::ConvertLineEnds() does not convert all line-ends

Bug
open-fixed
nobody
1
3 days ago
4 days ago
No

Issue: Document::ConvertLineEnds() uses a fixed length calculated at the start of the iteration. Because the document grows when inserting CRLF characters, the loop terminates before reaching the new end of the document. This leaves trailing line endings unconverted (e.g., remaining as LF when converting to CRLF).

Related

Commit: [ede299]

Discussion

  • Zufu Liu

    Zufu Liu - 4 days ago
    • labels: --> Scintilla, EOL
     
  • Zufu Liu

    Zufu Liu - 4 days ago

    I think simplest fix is just using

    for (Sci::Position pos = 0; pos < LengthNoExcept(); pos++)
    

    complex fix is update length = LengthNoExcept(); at end of DeleteChars() / InsertString() block.

     
    👍
    1
  • Rainer Kottenhoff

    For complex update a --length; resp ++length; at end of DeleteChars() / InsertString() block would work too, since delete/insert char length is 1.
    pos < LengthNoExcept() is more elegant and comparable fast.

     
  • Neil Hodgson

    Neil Hodgson - 3 days ago
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 3 days ago

    This was a regression in [0cf8bf].

    Committed fix with [614b4c],

     

    Related

    Commit: [0cf8bf]
    Commit: [614b4c]


Log in to post a comment.

MongoDB Logo MongoDB