Re: [code] [textadept] highlighting dates and hours

From: Pascal <patatetom.att.gmail.com>
Date: Wed, 5 Apr 2017 09:46:19 +0200

hi,

"something like this" works perfectly :-)

I recently discovered textadept and I find its side extensible, eg. its
malleability, formidable.
thank you for the help provided Mitchell and congratulations to the
developers for the work carried out around textadept.

regards, lacsaP.

2017-04-04 19:36 GMT+02:00 Mitchell <m.att.foicica.com>:

> Hi,
>
>
> On Tue, 4 Apr 2017, Pascal wrote:
>
> hi Mitchell,
>>
>> I chose to make several simple loops (by slightly rearranging my regular
>> expressions) and it works perfectly, well, so again, thank you for your
>> advice.
>>
>> can you help me on two other points?
>>
>> firstly, I use the function buffer.fold_all with the action
>> buffer.FOLDACTION_CONTRACT : it works, but only on the first level.
>>
>> events.connect(events.FILE_OPENED,
>> function()
>> ...
>> buffer.fold_all(buffer.FOLDACTION_CONTRACT)
>> buffer.read_only = true
>> end
>> )
>>
>> for example :
>>
>> <level1>
>> blabla
>> <level2>
>> blabla
>> </level2>
>> </level1>
>> <level1>
>> blabla
>> <level2>
>> blabla
>> </level2>
>> </level1>
>>
>> give the good display :
>>
>> + <level1>
>> + <level1>
>>
>> but, if I unfold the first folding, the second level is already unfolded :
>>
>> <level1>
>> blabla
>> <level2>
>> blabla
>> </level2>
>> </level1>
>> + <level1>
>>
>> and I would like :
>>
>> <level1>
>> blabla
>> + <level2>
>> </level1>
>> + <level1>
>>
>> is it possible ?
>>
>
> Yes, you should iterate over all lines and call `buffer:fold_children()`
> instead. Something like this may work:
>
> for i = 0, buffer.line_count - 1 do
> if buffer.fold_level[i] >= buffer.FOLDLEVELHEADERFLAG then
> buffer:fold_children(i, buffer.FOLDACTION_CONTRACT)
> end
> end
>
> Then, each fold you expand will only expand that level.
>
> and secondly, is it possible to disable syntax highlighting, especially on
>> xml language, without losing folding ?
>>
>
> No, this is not possible.
>
>
> Cheers,
> Mitchell
> --
> You are subscribed to code.att.foicica.com.
> To change subscription settings, send an e-mail to code+help.att.foicica.com.
> To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
>
>

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 05 Apr 2017 - 03:46:19 EDT

This archive was generated by hypermail 2.2.0 : Wed 05 Apr 2017 - 06:37:46 EDT