Re: Adding code folding to syntax highlighting

Enrico Mattea <[email protected]>
Newsgroups gmane.comp.kde.devel.kwrite
Message-ID <[email protected]>
Hi Christoph,

thanks a lot for your answer!

I'm not sure I understand - I thought my command (<StringDetect 
attribute="Keyword" context="#stay" String="begin" 
beginRegion="Control"/>) only starts a region if it finds a "begin" 
keyword (and not a "begin" character string)? And the two other commands 
have "endRegion="Control"/>" to close that region?

Sorry, I am not really familiar with these instructions!

All the best

Enrico


Il 29/11/20 16:06, Christoph Cullmann ha scritto:
> On 2020-11-27 11:46, Enrico Mattea wrote:
>> Bump, no-one got an idea on this?
>>
>> Very much appreciated!
>>
>
> Hi,
>
> For the for/endfor, I think one should only start a region
> for "for" not for any control keyword.
>
> You should perhaps add an extra rule for that.
>
> Greetings
> Christoph
>
>
>> Enrico
>>
>> ---
>> -------------------------
>>
>> Hi all,
>>
>> I am trying to add code folding to the RSI IDL syntax highlighting
>> [1],
>> for multi-line loops
>>
>> (syntax:
>>
>> for XXXX do begin
>>
>>    YYYY
>>
>> endfor)
>>
>> Following the documentation [2] and the example for a C source file
>> [3],
>> I have added the following lines to the "Normal" context in the xml
>> file:
>>
>> <StringDetect attribute="Keyword" context="#stay" String="begin"
>> beginRegion="Control"/>
>> <StringDetect attribute="Keyword" context="#stay" String="endfor"
>> endRegion="Control"/>
>> <StringDetect attribute="Keyword" context="#stay" String="endif"
>> endRegion="Control"/>
>>
>> But it doesn't work (no foldable sections are created in Kate).
>>
>> Any ideas on what I'm doing wrong? (Kate 17.12.3, KDE Frameworks 5.44,
>>
>> Kubuntu 18.04.5).
>>
>> Thanks a lot!
>>
>> Enrico
>>
>> [1] https://kate-editor.org/syntax/data/syntax/rsiidl.xml
>>
>> [2]
>> https://docs.kde.org/stable5/en/applications/katepart/highlight.html
>>
>> [3] https://kate-editor.org/syntax/data/syntax/c.xml
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.