dex
dex copied to clipboard
Add command-line option to go to a specific line on startup
E.g.:
$ dex +245 myfile
will open myfile with the cursor positioned on line 245.
This ensures compatibility with less.
For single files, you can already use:
dex -c 'line 245' myfile
For multiple files you can use:
dex -c 'open file1; line 245; open file2; line 120'
Does this new flag handle opening multiple files or just the first?
@craigbarnes, yes it is equivalent but note that:
- the
+
syntax is a convenient shorthand - it ensures compatibility with
less
'sv
command:
Invokes an editor to edit the current file being viewed.
I don't see this interfering with anything, especially since dte honours the --
flag in case you want to edit a file that starts with a +
. The option of dex being set as less' editor is a nice feature.
Only the first, which is consistent with the behavior of vim, nano and less.
I can't seem to make this option work at all with less
(even with a single file) but nano
seems to support using it for multiple files:
nano +500 src/edit.c +20 GNUmakefile +160 Documentation/dte.txt
I intend to implement this at some point in the dte fork (issue: dte-editor/dte#16).
Strange that less shouldn't work for you... Here it works, only for the first file, and nano
indeed works with more than one.