D22253: Improve the Fortran fixed format syntax highlighting

Nibaldo González noreply at phabricator.kde.org
Sat Jul 6 07:30:12 BST 2019


nibags accepted this revision.
nibags added a comment.
This revision is now accepted and ready to land.


  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.
  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:
  
    <RegExpr attribute="Comment" context="comment" String="." column="72" forceColumn="true" />
  
  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:
  
    <InjectRules>
        <RegExpr attribute="Comment" context="comment" String="." column="72" />
    </InjectRules>
  
  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). 
  Any idea or improvement in the highlighting of the comment in column 72, it can be done in another diff.
  
  I will also change the license of the file to MIT.

REPOSITORY
  R216 Syntax Highlighting

BRANCH
  fortran-fixed-format (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D22253

To: nononux, nibags
Cc: nibags, kwrite-devel, kde-frameworks-devel, LeGast00n, domson, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190706/4ce284c9/attachment.html>


More information about the KWrite-Devel mailing list