Re: [code] Foldind wiki text

From: Mitchell <m.att.foicica.com>
Date: Mon, 23 Apr 2018 15:38:14 -0400 (EDT)

Hi Mike,

On Mon, 23 Apr 2018, RB wrote:

>
> Good day!
>
> I use WikidPad (http://wikidpad.sourceforge.net/) program for taking notes.
> This program is written in Python, the engine - Scintilla.
> The format of the notes - plain text with wiki-markup.
> Folding on the headers.
> The header sign is the '+' symbol at the first position of the line.
> One or more according to the title level.
> Since the program is written in Python, editing large texts is slow.
> Sometimes you have to run gedit for editing, but there is no folding in it.
>
>
> Can I configure Textadept to edit files with the wiki and folding extension
> '+', '++', '+...+ ' ?
> How to do it?

I do not think Textadept has a built-in lexer that would handle your file format and folding, so you would have to write your own. This would probably not be a trivial task, but it seems do-able. Documentation on writing lexers is here: https://foicica.com/textadept/api.html#lexer. Documentation on folding is here: https://foicica.com/textadept/api.html#lexer.Code.Folding. You will probably need to know a bit of Lua in order to write a function that correctly processes '+...+' fold points. (See the `fold_strange_token` function for an example).

I hope this helps.

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.
Received on Mon 23 Apr 2018 - 15:38:14 EDT

This archive was generated by hypermail 2.2.0 : Tue 24 Apr 2018 - 06:46:53 EDT