Re: [code] Some advice on textadept programming

From: Robert Gieseke <rob.g.att.web.de>
Date: Tue, 03 Feb 2015 19:12:11 +0100

Hi Carlos,

Am 03/02/15 um 18:53 schrieb Carlos Pita:
[…]
> say I could babble some lua and I wanted to code a new ta module or
> some advanced configuration. In that case I would need some advice
> from the savvy:
>
> 1) How do you reload and inspect your changes? [1] I know that C-e
> opens the command entry, but I'm looking for concrete advice: do you
> run something like "reset(); my_function()" or what?

This should work. You could also assign these to a short cut key.

> 2) How do you debug or trace your changes? Do you just io.print?

Just `print` should output to the console, on OS X you could look at
Console.log app output or start Textadept from within the App directory,
on Linux it should just print to the Terminal.

Another way is using `ui.statusbar_text`:
ui.statusbar_text = 'your debug message '..tostring(idx)

>
> 3) In general: do you have any useful patterns or techniques to share?

Depending on what you do it might be helpful to have another instance of
Textadept or another editor open, in case you break the startup process.

You've probably already seen this, but if not, Lua in just "y" minutes:
http://learnxinyminutes.com/docs/lua/

With Scintillua and lexer development it might also be an option to use
it as an independent library for developing and testing your lexer, at
least for temporary debugging[1].

Cheers,
Robert

[1] http://foicica.com/scintillua/manual.html

-- 
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 03 Feb 2015 - 13:12:11 EST

This archive was generated by hypermail 2.2.0 : Wed 04 Feb 2015 - 06:44:36 EST