Yes, thanks. Ubuntu version still contains this bug, but snapshot works fine.<br><br><br><div class="gmail_quote">2011/10/2 Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Fri, 30 Sep 2011 10:47:22 +0300, Andrei Kopats <<a href="mailto:hlamer@tut.by">hlamer@tut.by</a>> wrote:<br>
> Hi<br>
><br>
> I have problem with EOLs in QScintilla.<br>
><br>
> Let's open 2 QScintilla based editors. First is configured to work in CR<br>
> EOL<br>
> mode, and second in LF EOL mode.<br>
> If I copy text from first to second - second contains mix of different<br>
EOL<br>
> modes.<br>
> To see it, activate EOL symbols visibility or check saved file with hex<br>
> editor.<br>
><br>
> I think, when pasting, QScintilla should automatically convert EOLs of<br>
> pasted text to current EOL mode of the file.<br>
><br>
> I can not reproduce this bug on SciTE, seems, Qt implementation<br>
specific.<br>
> I also checked SciTE code, it seems, it does not do any conversions when<br>
> pasting, but only calls Scintilla GTK implementation.<br>
><br>
> This problem was discussed on QScintilla bugtracker<br>
><br>
<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1216370&group_id=2439&atid=352439" target="_blank">https://sourceforge.net/tracker/index.php?func=detail&aid=1216370&group_id=2439&atid=352439</a><br>
><br>
> I discovered, that JuffED fixes this problem in its code, but, I think,<br>
it<br>
> would be better, if QScintilla handles it...<br>
><br>
><br>
> void JuffScintilla::paste() {<br>
> QString originalText = QApplication::clipboard()->text();<br>
> QString convertedText;<br>
> if ( originalText.contains(LineSeparatorRx) ) {<br>
> QStringList lines = originalText.split(LineSeparatorRx);<br>
> switch ( eolMode() ) {<br>
> case EolWindows : convertedText = lines.join("\r\n"); break;<br>
> case EolUnix : convertedText = lines.join("\n"); break;<br>
> case EolMac : convertedText = lines.join("\r"); break;<br>
> }<br>
> QApplication::clipboard()->setText(convertedText);<br>
> }<br>
><br>
> if ( SendScintilla(SCI_SELECTIONISRECTANGLE) ) {<br>
> QString text = QApplication::clipboard()->text();<br>
> int line1, col1, line2, col2;<br>
> getOrderedSelection(line1, col1, line2, col2);<br>
><br>
> beginUndoAction();<br>
> deleteRectSelection(line1, col1, line2, col2);<br>
> for ( int line = line2; line >= line1; --line ) {<br>
> insertAt(text, line, col1);<br>
> }<br>
> endUndoAction();<br>
> }<br>
> else {<br>
> QsciScintilla::paste();<br>
> }<br>
><br>
> // restore the original clipboard content<br>
> QApplication::clipboard()->setText(originalText);<br>
> }<br>
><br>
><br>
> Andrei Kopats<br>
<br>
</div></div>Works fine for me with the current version.<br>
<font color="#888888"><br>
Phil<br>
</font></blockquote></div><br>