[code] Jumping to a line from the command line

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Thu, 28 Mar 2013 16:43:10 +0800

For purposes of integration with a development environment, I'd like to be
able to jump to a given line upon opening a file. I tried the following
code with no success:

textadept --force --execute '_G.buffer:goto_line(21)' my_file

*Within* a running instance this works (except that it goes to line 22 for
some reason) so I tried adding the following to my init.lua:

function my_goto_line(line)
> _G.buffer:goto_line(line - 1)
> end
> args.register('-J', '--JUMP', 1, my_goto_line, 'Jump to line')

The -J/--JUMP option shows up when I do --help from the command line, but
actually using it accomplishes nothing.

Is there any way to get this to work from the command line?

"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
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 28 Mar 2013 - 04:43:10 EDT

This archive was generated by hypermail 2.2.0 : Thu 28 Mar 2013 - 06:48:23 EDT