8000 Add command-line option to go to a specific line on startup by parras · Pull Request #38 · tihirvon/dex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add command-line option to go to a specific line on startup #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

parras
Copy link
@parras parras commented Apr 29, 2016

E.g.:
$ dex +245 myfile
will open myfile with the cursor positioned on line 245.
This ensures compatibility with less.

E.g.:
$ dex +245 myfile
will open myfile with the cursor positioned on line 245.
This ensures compatibility with less.
@craigbarnes
Copy link
Contributor
craigbarnes commented Jul 22, 2017

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?

@parras
Copy link
Author
parras commented Jul 26, 2017

@craigbarnes, yes it is equivalent but note that:

  1. the + syntax is a convenient shorthand
  2. it ensures compatibility with less's v command:

Invokes an editor to edit the current file being viewed.

@pepa65
Copy link
pepa65 commented Jul 26, 2017

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.

@craigbarnes
Copy link
Contributor

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).

@pepa65
Copy link
pepa65 commented Jul 26, 2017

Strange that less shouldn't work for you... Here it works, only for the first file, and nano indeed works with more than one.

@craigbarnes
Copy link
Contributor
craigbarnes commented Jul 30, 2017

This is implemented in the dte fork now, in commit 22138515.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0