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

From: Mitchell <m.att.foicica.com>
Date: Thu, 11 Jul 2019 22:31:31 -0400 (EDT)

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.
Received on Thu 11 Jul 2019 - 22:31:31 EDT

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