diff options
author | mitchell <70453897+667e-11@users.noreply.github.com> | 2018-11-27 11:20:31 -0500 |
---|---|---|
committer | mitchell <70453897+667e-11@users.noreply.github.com> | 2018-11-27 11:20:31 -0500 |
commit | c1f6b2b75b3853d2eb6b07b83dd6be8bc4c87bbf (patch) | |
tree | 3f48668444a40f4ab19f54447d902aa4e166e670 | |
parent | 24de6b2672d6f653e7d0691482e96bfc43b179ef (diff) |
Added command line switch to jump to a buffer line.
This is more convenient than '-e "goto_line(n - 1)"'.
-rw-r--r-- | doc/manual.md | 1 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 1 |
2 files changed, 2 insertions, 0 deletions
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. |