D18516: Fix end of folding region in rules with lookAhead=true

Dominik Haumann noreply at phabricator.kde.org
Sat Jan 26 11:24:21 GMT 2019


dhaumann added a comment.


  Interesting idea.
  
  This changes all C/C++ Preprocessor #if/elsif/endif regions to empty code folding regions.
  
  What I plan on KTextEditor is the following feature: for code folding of e.g. in LaTeX:
  
    \begin{document}
        \begin{center}
        Blaaa
        \end{center}
    \end{document}
  
  Consider the cursor is moved in the begin{document} text, then I want to highlight the text \begin{document} and the counterpart \end{document} that define a folding region with a moving range. As you see, it is required to know the offset width of the folding regions then.
  
  This will still work with this patch, since the rules do not use lookAhead. But for Preprocessor if...elsif...endif it will not work anymore.
  
  Question is: is that / will that be a problem?
  
  I think this patch requires a bit manual testing, but in itself it's a good patch.

REPOSITORY
  R216 Syntax Highlighting

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

To: nibags, #framework_syntax_highlighting, cullmann, dhaumann, #ktexteditor
Cc: andreasgr, kwrite-devel, kde-frameworks-devel, hase, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190126/f1399499/attachment.html>


More information about the KWrite-Devel mailing list