From c1f6b2b75b3853d2eb6b07b83dd6be8bc4c87bbf Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 27 Nov 2018 11:20:31 -0500 Subject: Added command line switch to jump to a buffer line. This is more convenient than '-e "goto_line(n - 1)"'. --- doc/manual.md | 1 + modules/textadept/editing.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/manual.md b/doc/manual.md index 02b77e37..08fdf48e 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -1808,6 +1808,7 @@ Switch |Arguments|Description `-e`, `--execute` | 1 |Run Lua [code](#Lua.Command.Entry). `-f`, `--force` | 0 |Forces [unique instance](#Single.Instance). `-h`, `--help` | 0 |Shows this. +`-l`, `--line` | 1 |Jumps to a line in the previously opened file. `-n`, `--nosession`| 0 |No [session](#Sessions) functionality. `-s`, `--session` | 1 |Loads [session](#Sessions) on startup. `-u`, `--userhome` | 1 |Sets alternate [`_USERHOME`][]. diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 2d6ded80..c88781e0 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -287,6 +287,7 @@ function M.goto_line(line) buffer:ensure_visible_enforce_policy(line) buffer:goto_line(line) end +args.register('-l', '--line', 1, function(line) M.goto_line(line - 1) end) --- -- Transposes characters intelligently. -- cgit v1.2.3