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

From: Pascal <patatetom.att.gmail.com>
Date: Wed, 5 Apr 2017 11:39:48 +0200

with

and without statement


2017-04-05 11:26 GMT+02:00 Pascal <patatetom.att.gmail.com>:

> strangely, after a few file openings, it appears that if a xml file
> starts with a statement like <?xml version="1.0" encoding="UTF-8"?>, the
> for loop doesn't fold the content... (and when I remove it, all is ok) after
> checking, my xml file is "well formed".
>
> 2017-04-05 9:46 GMT+02:00 Pascal <patatetom.att.gmail.com>:
>
>> 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.
2017.04.05-11.35.45.png 2017.04.05-11.35.30.png
Received on Wed 05 Apr 2017 - 05:39:48 EDT

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