Re: [code] [Textadept] Enriching Lua highlighting, have some questions

From: Mitchell <m.att.foicica.com>
Date: Mon, 7 Apr 2014 08:54:19 -0400 (EDT)

Hi Advert,

On Wed, 2 Apr 2014, Advert Slaxxor wrote:

> On Mon, Mar 31, 2014 at 8:00 PM, Mitchell <m.att.foicica.com> wrote:
>
>> Hi Advert,
>>
>> I think the idea is good in principle and quite useful. However, marking
>> text based on context using a lexer is probably not the best idea. For
>> performance reasons, lexers are only given parts of the entire buffer to
>> lex at a time. A better method for you would probably be to have a function
>> process the entire buffer and use indicators to mark text instead of using
>> lexer styles. This function could be run in an interval, when the buffer is
>> saved, etc.
>>
>> Textadept's source code has examples of indicator use for marking text.
>>
>> Cheers,
>> Mitchell
>>
>
> Figured that out after messing around with it for a little while -- it'd
> require large amounts of backtracking/seeking, or embedded lexers. That'd
> be quite the mess! :)
>
> I'll have rethink this quite a bit, it seems. Sometimes you just see the
> meaty functions doing things, not realizing the supporting code buried
> underneath!

I forgot to mention you can make use of Textadept's Lua lexer
externally[1]. In Textadept's case, `lexer` is already loaded, so you can
simply call `lexer.load('lua')` out of the box.

Cheers,
Mitchell

[1]: http://foicica.com/scintillua/01_Installation.html#Using.Scintillua.as.a.Lua.Library

-- 
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 07 Apr 2014 - 08:54:19 EDT

This archive was generated by hypermail 2.2.0 : Tue 08 Apr 2014 - 06:49:12 EDT