[bugs:#2501] Document::ConvertLineEnds() does not convert all line-ends
Status: open
Group: Bug
Created: Mon Mar 09, 2026 11:05 PM UTC by Rainer Kottenhoff
Last Updated: Mon Mar 09, 2026 11:05 PM UTC
Owner: nobody
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).
Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
[bugs:#2501] Document::ConvertLineEnds() does not convert all line-ends
Status: open
Group: Bug
Labels: Scintilla EOL
Created: Mon Mar 09, 2026 11:05 PM UTC by Rainer Kottenhoff
Last Updated: Mon Mar 09, 2026 11:05 PM UTC
Owner: nobody
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.
[bugs:#2501] Document::ConvertLineEnds() does not convert all line-ends
Status: open
Group: Bug
Labels: Scintilla EOL
Created: Mon Mar 09, 2026 11:05 PM UTC by Rainer Kottenhoff
Last Updated: Mon Mar 09, 2026 11:50 PM UTC
Owner: nobody
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.
[bugs:#2501] Document::ConvertLineEnds() does not convert all line-ends
Status: open
Group: Bug
Labels: Scintilla EOL
Created: Mon Mar 09, 2026 11:05 PM UTC by Rainer Kottenhoff
Last Updated: Tue Mar 10, 2026 12:30 AM UTC
Owner: nobody
This was a regression in [0cf8bf].
Committed fix with [614b4c],
[bugs:#2501] Document::ConvertLineEnds() does not convert all line-ends
Status: open-fixed
Group: Bug
Labels: Scintilla EOL
Created: Mon Mar 09, 2026 11:05 PM UTC by Rainer Kottenhoff
Last Updated: Tue Mar 10, 2026 10:17 AM UTC
Owner: nobody
[bugs:#2501] Document::ConvertLineEnds() does not convert all line-ends
Status: closed-fixed
Group: Bug
Labels: Scintilla EOL
Created: Mon Mar 09, 2026 11:05 PM UTC by Rainer Kottenhoff
Last Updated: Tue Mar 10, 2026 10:49 PM UTC
Owner: nobody