Skip to content
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

Does not support the +N syntax and cannot be used as $EDITOR #47

Closed
cyril-bouthors opened this issue Mar 15, 2016 · 10 comments
Closed

Does not support the +N syntax and cannot be used as $EDITOR #47

cyril-bouthors opened this issue Mar 15, 2016 · 10 comments
Labels

Comments

@cyril-bouthors
Copy link

rmate does not support the +N syntax which is supposed to place caret on line number after loading file, just like --line:

$ ./rmate +3 /etc/fstab
There is more than one file specified. Opening only +3 and ignoring other.

Others editors like vi, emacs, mg support this, even nano:

emacs +3 /etc/fstab
vi +3 /etc/fstab
nano +3 /etc/fstab
mg +3 /etc/fstab

I prevents some program like 'debchange' to work:

$ export EDITOR='rmate -w'
$ debchange -i
There is more than one file specified. Opening only +3 and ignoring other.

and SublimeText opens the file called "+3"

Would it be possible to support +N as an alias to --line=N?

Thank you

PS: sorry about my initial bug report, I apparently triggered a shortcut to open the ticket before it was done

@aurora
Copy link
Owner

aurora commented Mar 15, 2016

I think this should be easy to implement. I'll have a look at it, thanks for your suggestion.

aurora added a commit that referenced this issue Mar 15, 2016
@aurora
Copy link
Owner

aurora commented Mar 15, 2016

Could you have a look at my latest commit? I think it should work now what you would like to do.

@cyril-bouthors
Copy link
Author

@aurora,

The latest commit seems to be working but the caret stays on line 1.

Same issue with

rmate --line 3 /tmp/x

screen shot 2016-03-15 at 18 50 36

@aurora
Copy link
Owner

aurora commented Mar 15, 2016

mmm ... i have to admit that i only tested with textmate ... i'll have a look at sublime later today.

@aurora
Copy link
Owner

aurora commented Mar 16, 2016

It does not seem to be possible with sublime text. at least: the subl command of sublime text itself does not offer a --line option, either ... ? As i am TextMate user i have no knowledge regarding the possibilities of Sublime Text from command-line, but i'll happily add support, if someone can point me to a reference of this tool. There's a --command option for example ... can this feature be achieved using this option?

@cyril-bouthors
Copy link
Author

The syntax is FILE:LINE_NUMBER, example:

subl /etc/hosts:2

@aurora
Copy link
Owner

aurora commented Mar 17, 2016

Apparently i misunderstood how things work with sublime text. Sublime text is using the rsub package to achieve the remote editing functionality. So in my opinion a fix for the problem would belong to this package. As i am not the author of rsub, there's not much that i can do. But i'll have a look at it and maybe i can provide a patch for it ...

@cyril-bouthors
Copy link
Author

Thanks
On Thu, Mar 17, 2016 at 2:07 PM Harald Lapp notifications@github.com
wrote:

Apparently i misunderstood how things work with sublime text. Sublime text
is using the rsub package to achieve the remote editing functionality. So
in my opinion a fix for the problem would belong to this package. As i am
not the author of rsub, there's not much that i can do. But i'll have a
look at it and maybe i can provide a patch for it ...


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#47 (comment)

Cyril Bouthors - go-managed.com http://www.go-managed.com/
+33-1-84-16-16-17
https://www.linkedin.com/in/cyrilbouthors

@aurora
Copy link
Owner

aurora commented Mar 17, 2016

@cyril-bouthors i think i have a working patch for this, as i don't know how fast the original author of rsub is, you can fetch the change from my rsub fork at https://github.com/aurora/rsub in the meantime.

@cyril-bouthors
Copy link
Author

Great!

On Thu, Mar 17, 2016 at 5:38 PM Harald Lapp notifications@github.com
wrote:

@cyril-bouthors https://github.com/cyril-bouthors i think i have a
working patch for this, as i don't know how fast the original author of
rsub is, you can fetch the change from my rsub fork at
https://github.com/aurora/rsub in the meantime.


You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub
#47 (comment)

Cyril Bouthors - go-managed.com http://www.go-managed.com/
+33-1-84-16-16-17
https://www.linkedin.com/in/cyrilbouthors

@aurora aurora closed this as completed Mar 18, 2016
@aurora aurora added the feature label Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants