Re: [code] [textadept] Am I executing a snippet ?

From: Richard Philips <richard.philips.att.gmail.com>
Date: Tue, 28 May 2013 20:37:54 +0200

Thanks!

You are really very helpful.

I will use it for redefining the Tab key.

I wrote a quite advanced textadept lexer and co for the M programming language.
M is a dreadful programming language but with one redeeming feature: a state of the art builtin nosql database which is as easy to use as tables in Lua (even more so)

The Tab key is very useful for all kind of manipulations in M but in snippets it should retain its usual function.

R.

On 28 May 2013, at 16:00, Mitchell <m.att.foicica.com> wrote:

> Hi Richard,
>
> On Mon, 27 May 2013, Richard Philips wrote:
>
>> Hi,
>>
>> is there a non-destructive way to infer in my Lua code if it is executing
>> in the context of a snippet ?
>>
>>
>> The _M.textadept.snippets._previous function has that property but is 'destructive'.
>> It is based on a local table `snippet_stack`.
>
> It's a hack, but you can use
>
> if buffer:indicator_end(10, 0) > 0 then
> -- snippet is active
> end
>
> I used a `gui.print()` statement in the snippets module to temporarily determine the indicator number for snippet end points.
>
> 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 Tue 28 May 2013 - 14:37:54 EDT

This archive was generated by hypermail 2.2.0 : Wed 29 May 2013 - 06:54:21 EDT