Re: [textadept] newbie question on textadept fold

From: mitchell <c....at.caladbolg.net>
Date: Thu, 5 May 2011 11:28:52 -0400 (Eastern Daylight Time)

Hi Terry,

On Thu, 5 May 2011, Terry Chen wrote:

> Hi,
> I just started to use textadept, and I have a question about folding.
> Does textadept only support folding by indentation?

At the moment, although the dmd lexer does support folding through user
contribution. I don't have time to implement proper folding for all
lexers.

> Or is only a subset of language support folding via syntax (like "{", "}")?
>
> When I set�buffer.property['fold.by.indentation'] = '0',
> I get an error: �"Lua Error: Table of folds expected from lexer.fold"

This sounds like a bug. You modified the property in your theme file,
restarted textadept, and then what? I cannot reproduce this.

>
> Coming from scite, I was a little bit surprised by this. It makes me believe that I am doing something
> wrong.
> Is there a setting somewhere in textadept to use scite's (or scintilla's) originally lexer and
> folding?

No, textadept's lexers are independent of Scintilla's.

> If not, how can I go about modifying the lpeg lexers to support folding.
> Poking my head around the source code seems to point me to the _fold function as an entry point to
> implement custom folding levels.
> Am I going down the right direction with this? And does anyone have some examples of some folding code
> not based on indentation?

Again, take a look at the dmd lexer; it may help you. The lexer
LuaDoc will also be of help:
http://caladbolg.net/luadoc/textadept/modules/lexer.html (search for "Code
folding".

mitchell
Received on Thu 05 May 2011 - 11:28:52 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:06:11 EST