<p></p>
<blockquote>
<p dir="auto">Do you have any good source of sample files that could be used as unit tests?</p>
</blockquote>
<p dir="auto">Before anything, you'll need to apply this patch: <a href="https://github.com/geany/geany/files/8694983/Fix-EOL-splitting-in-LexVisualProlog.diff.txt">Fix-EOL-splitting-in-LexVisualProlog.diff.txt</a></p>
<p dir="auto">Lexilla's testing protocol has dramatically improved over the past year, and it now checks for consistency across EOL modes. A hard failure is raised if the CR and LF of a Windows EOL is in two different styles, e.g.,</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/59004801/168474150-2678acee-8906-450a-9cf3-594972442e79.png"><img src="https://user-images.githubusercontent.com/59004801/168474150-2678acee-8906-450a-9cf3-594972442e79.png" alt="vpl-eol-splits" style="max-width: 100%;"></a></p>
<p dir="auto">In fairness to the lexer, the problem really comes from the flawed implementation of <code class="notranslate">StyleContext::atLineEnd</code> (mitigated in <a href="https://github.com/ScintillaOrg/lexilla/blob/9818085b561cc59243afc3f768db20664e6a135b/lexlib/StyleContext.h">Lexilla 5.1.0</a>). It doesn't account for newlines longer than a single character <sup><a href="#user-content-fn-1-2972e974bfa431648814b54e80d3911a" id="user-content-fnref-1-2972e974bfa431648814b54e80d3911a" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup> , so you can end up with <code class="notranslate"><false>CR<true>LF</code></p>
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
<ol dir="auto">
<li id="user-content-fn-1-2972e974bfa431648814b54e80d3911a">
<p dir="auto"><a href="https://github.com/ScintillaOrg/lexilla/blob/a35a59845e793d9d37d249cf097e71fecc5f4bcd/lexlib/StyleContext.h#L35-L40">https://github.com/ScintillaOrg/lexilla/blob/a35a59845e793d9d37d249cf097e71fecc5f4bcd/lexlib/StyleContext.h#L35-L40</a> <a href="#user-content-fnref-1-2972e974bfa431648814b54e80d3911a" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content"><g-emoji class="g-emoji" alias="leftwards_arrow_with_hook" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/21a9.png">↩</g-emoji></a></p>
</li>
</ol>
</section>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3171#issuecomment-1126938625">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ2PJZPJUEFBAPCJL6TVKDZ2DANCNFSM5TSVVLDQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ5QBNGVB3F5F7GOSOLVKDZ2DA5CNFSM5TSVVLD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIMV3QAI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/pull/3171/c1126938625</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3171#issuecomment-1126938625",
"url": "https://github.com/geany/geany/pull/3171#issuecomment-1126938625",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>