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

Request: add to tag stack when using ALEGoToDefinition OR add a ALEGoBackFromDefinition #1236

Closed
dylan-chong opened this issue Dec 18, 2017 · 9 comments · Fixed by #2448
Closed

Comments

@dylan-chong
Copy link

Vim shortcuts pair <C-]> and <C-t> nicely. With ALEGoToDefinition, there isn't a nice equivalent jump back command (e.g. <C-t> ALEGoBackFromDefinition or <C-t>) which would be nice to have.

@w0rp
Copy link
Member

w0rp commented Apr 23, 2018

You can use <C-o>. See :help jump-motions.

@w0rp w0rp closed this as completed Apr 23, 2018
w0rp added a commit that referenced this issue Apr 23, 2018
@chaucerbao
Copy link
Contributor

I've been using <C-o> as well, but the main difference is that <C-t> returns to the point where the previous <C-]> jump was made.

With <C-o>, you step backwards through all the jump movement history you may have made while looking around the definitions, and jumping into deeper definitions.

A <C-t> would be nice, but <C-o> is workable.

@dylan-chong
Copy link
Author

@chaucerbao Yup. That's actually why i mentioned this issue.

@w0rp Is it possible for ALEGoToDefinition to increment the tag stack so we can use C-t to jump back?

@w0rp w0rp reopened this Apr 24, 2018
@w0rp
Copy link
Member

w0rp commented Apr 24, 2018

Okay, what is a tag stack, and how do I increment it?

@dylan-chong
Copy link
Author

h tag && h tagstack.

I'm not an expert on vim so you may want to get a second opinion before implementing this feature. Maybe this isn't a good idea for some reason we don't know about, or maybe there is a nice solution we don't know about.

@dylan-chong
Copy link
Author

dylan-chong commented Apr 24, 2018

On second thought, I am considering that better possible solution would be to have the existing ALEGoToDefinition, add a new ALEGoBackFromDefinition (or some other name), and have some optional way to seamlessly integrate Ale with the C-t and C-] shortcuts (by having an option for the a ALE commands to manipulate the tag stack). This way we don't force any unexpected behaviour upon the tags system, while giving vim users the option for convenience.

I would still definitely need some extra opinions on the above ideas. I am not 100% confident that either of the above options are the best solution

@w0rp
Copy link
Member

w0rp commented Apr 24, 2018

What would this new command do that Ctrl+O doesn't do already?

@dylan-chong
Copy link
Author

As @chaucerbao said, C-o is not the same as C-t. vim help menus will tell you more about them

I was thinking that ale would use its own internal stack that has the information required for ALEGoBackFromDefinition to work.

@w0rp
Copy link
Member

w0rp commented Apr 24, 2018

I think the right thing to do is to update the tag stack, and add an option for disabling that behaviour. That will probably make everyone happy.

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

Successfully merging a pull request may close this issue.

3 participants