[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: C++ highlighting / indenting
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2014-02-03 18:01:44
Message-ID: lcolhr$cov$1 () ger ! gmane ! org
[Download RAW message or body]

On 2014-02-01 15:53, Dominik Haumann wrote:
> On Saturday 01 February 2014 12:53:34 Milian Wolff wrote:
>> On Friday 31 January 2014 22:12:12 Christoph Cullmann wrote:
>>> Should we perhaps btw. include Qt5, too? And perhaps just color the
>>> different versions differently? e.g. one color for classes that are in
>>> both
>>> version and one for qt4/qt5 version classes only? And rename it to C++/Qt
>>
>> Imo, just put it all together into one file but don't use different colors -
>> that would be too confusing imo.
>
> I agree with Milian to just merge all these variants into one single C++ hl
> file. We don't have the resources to maintain lots of different variants in
> the long run.

I've maybe said this before, but it would be awesome if katepart 
supported a way to add keywords to contexts.

What I would like to do is to be able to write a HL that said "use the 
regular C++ highlighting, but add these additional keywords to 
<context(s)>". Where the keywords would have their own distinct coloring.

This would allow me to e.g. write my own per-project HL's to add project 
specific keywords without copying the entire C++ HL logic. And it would 
(mostly) solve the maintenance issue because there would not be multiple 
instances of the core HL logic. (You'd still have to update all of the 
dependent HL's if the structure of the base HL logic changed.)

Maybe something like:

   <contexts>
     <!-- optional: new ability to include root context also -->
     <IncludeRules contexts="##C++>
     <context name="Normal" inline="true">
       <keyword attribute="..." context="#stay" String="..."/>
     </context>
     <context attribute="Comment" prepend="true">
       <!-- additional rules -->
     </context>
   </contexts>

The idea is to load the contexts from the IncludeRules, and then allow 
those contexts to be modified by specifying {prepend,append}="true". The 
special syntax inline="true" would require that the context support 
extension by having an 'insertion placeholder' context rule.

-- 
Matthew

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic