<div dir="ltr"><div><div>I don't think it would be sane to rely on this.<br></div>But even if we'd really want this feature, then it is broken by virtue of nextChunkPut: which does honour the lineEndConvention... So we have to change one or the other.<br>
<br></div>The main drawback of not forcing cr is that it makes it hard to compare code thru changeList (for example recent Cuis is using LF). I can implement other workarounds though.<br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">2013/11/1 Levente Uzonyi <span dir="ltr"><<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think it's intentional. The content of the chunks shouldn't be changed while being read. Let's say I implement #isCr: as<br>
<br>
isCr: aCharacter<br>
<br>
^$<br>
== aCharacter<br>
<br>
By default it will return true if the argument foo is a carriage return character, otherwise false. But if we allow changing the line endings in chunks, then its behavior might be different after loading.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Levente</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Thu, 31 Oct 2013, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Nicolas Cellier uploaded a new version of MultilingualTests to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/MultilingualTests-nice.17.mcz" target="_blank">http://source.squeak.org/<u></u>trunk/MultilingualTests-nice.<u></u>17.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: MultilingualTests-nice.17<br>
Author: nice<br>
Time: 31 October 2013, 11:54:33.464 pm<br>
UUID: 6de55950-5fff-43d1-9ce0-<u></u>8b661515f618<br>
Ancestors: MultilingualTests-tpr.16<br>
<br>
Add a test showing that MultiByteFileStream>>nextChunk fails to honour its own lineEndConvention.<br>
<br>
=============== Diff against MultilingualTests-tpr.16 ===============<br>
<br>
Item was added:<br>
+ ----- Method: MultiByteFileStreamTest>><u></u>testLineEndingChunk (in category 'testing') -----<br>
+ testLineEndingChunk<br>
+<br>
+ fileName := 'foolinend.txt'.<br>
+ MultiByteFileStream forceNewFileNamed: fileName do: [ :file |<br>
+ file<br>
+ wantsLineEndConversion: false;<br>
+ nextPutAll: 'line 1'; cr;<br>
+ nextPutAll: 'line 2'; crlf;<br>
+ nextPutAll: 'line 3'; lf;<br>
+ nextPutAll: 'line 4'; nextPut: $!! ].<br>
+ {<br>
+ {#cr. 'line 1' , String cr , 'line 2' , String cr , 'line 3' , String cr , 'line 4'}.<br>
+ {#lf. 'line 1' , String cr , 'line 2' , String cr , 'line 3' , String cr , 'line 4'}.<br>
+ {#crlf. 'line 1' , String cr , 'line 2' , String cr , 'line 3' , String cr , 'line 4'}.<br>
+ {nil. 'line 1' , String cr , 'line 2' , String crlf , 'line 3' , String lf , 'line 4'}<br>
+ } do: [:lineEndingResult |<br>
+ MultiByteFileStream oldFileNamed: fileName do: [ :file |<br>
+ file lineEndConvention: lineEndingResult first.<br>
+ self assert: lineEndingResult last equals: file nextChunk ] ]!<br>
<br>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br></div>