<table><tr><td style="">nibags accepted this revision.<br />nibags added a comment.<br />This revision is now accepted and ready to land.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D22253">View Revision</a></tr></table><br /><div><div><p>That is complicated to do, we would have to make rules for all the columns before 72 and for all the possible matchings, which is a lot of work and would make the code difficult to maintain.<br />
I think a better solution is to add the functionality to the highlighting engine, for example, allowing a rule to be forced in a column, so that it can be applied above of any context. It can be something like this:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><RegExpr attribute="Comment" context="comment" String="." column="72" forceColumn="true" /></pre></div>
<p>Another option is to allow having a set of rules that are applied above of the rest of the syntax highlighting; something like "injecting" rules. Such a feature could also be used in the PHP highlighter, instead of the generator script. For example:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><InjectRules>
<RegExpr attribute="Comment" context="comment" String="." column="72" />
</InjectRules></pre></div>
<p>I think the patch is fine like that. If there is no problem, I will land this patch (to be included in the next version of KDE Frameworks). <br />
Any idea or improvement in the highlighting of the comment in column 72, it can be done in another diff.</p>
<p>I will also change the license of the file to MIT.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R216 Syntax Highlighting</div></div></div><br /><div><strong>BRANCH</strong><div><div>fortran-fixed-format (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D22253">https://phabricator.kde.org/D22253</a></div></div><br /><div><strong>To: </strong>nononux, nibags<br /><strong>Cc: </strong>nibags, kwrite-devel, kde-frameworks-devel, LeGast00n, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann<br /></div>