Re: [code] [textadept] Testing 'arg' before and after resetting Textadept

From: Brandon Irizarry <brandon.irizarry.att.gmail.com>
Date: Fri, 12 Jul 2019 06:23:36 -0400

Thanks. I was able to confirm this. It turns out that I was able to use
'events.RESET_BEFORE' and 'events.RESET_AFTER' to accomplish
my purpose.

Brandon

On Thu, Jul 11, 2019 at 10:32 PM Mitchell <m.att.foicica.com> wrote:

> Hi Brandon,
>
> On Thu, 11 Jul 2019, Brandon Irizarry wrote:
>
> > Hi Mitchell,
> >
> > I'm using Textadept 10.5 on Arch Linux. I'd like to have some code that
> > only executes when I first
> > start Textadept. The API states:
> >
> > "arg is set to nil when reinitializing the Lua State. Any scripts that
> need
> > to differentiate between startup and reset can test arg."
> >
> > But I find that this doesn't happen; that is, I first start Textadept,
> and
> > the value of arg is { 0 = textadept }; similarly with curses, it's
> > {0 = textadept-curses }. However, calling 'reset' at the command entry
> in
> > either one doesn't change these values.
> >
> > Any help or pointers would be appreciated.
>
> `arg` is only `nil` during a reset. It is restored after the reset
> completes. On Linux you can test this by putting a `print(arg)` in your
> *~/.textadept/init.lua*, running Textadept from a terminal, and observing
> the output on startup and during a call to `reset()`.
>
> 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 Fri 12 Jul 2019 - 06:23:36 EDT

This archive was generated by hypermail 2.2.0 : Fri 12 Jul 2019 - 06:49:35 EDT