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

jump_prev jumps too far #1424

Closed
1 task
chuckfossen opened this issue Sep 30, 2016 · 3 comments
Closed
1 task

jump_prev jumps too far #1424

chuckfossen opened this issue Sep 30, 2016 · 3 comments

Comments

@chuckfossen
Copy link

Summary

I use jump_prev in conjuction with the Ctags plugin.
Often, jump_prev acts like it the previous location was not recorded.
How does Sublimetext decide where it puts it's markers down when I navigate a file?

Expected behavior

Typical use case:

  1. Start at some location in file.
  2. Jump to definition1
  3. Jump to definition2
  4. jump_prev (brings me back to definition1)
  5. jump_prev (brings me back to the original location)

Actual behavior

Often, but not always, jump_prev will jump back to the original location when I'm in definition2 like it didn't record the location of definition1 when I jumped to definition2.

Steps to reproduce

See Expected behavior

Environment

  • Operating system and version:
    • Mac OS 10.11.6
  • Sublime Text:
    • Build 3124 although this problem has been ongoing through multiple upgrades.
@keith-hall
Copy link
Collaborator

It looks like the Default/history_list.py file contains logic that will add an entry to the jump history when using the show_definition command. I am guessing your third party plugin has it's own command that this built-in plugin doesn't look for. Perhaps the best solution would be for Ctags to be updated to import the built-in plugin and add it's jump history to the global variable used there, rather than have the Default package try to cater for every single third party action which affects the caret/selections?

@chuckfossen
Copy link
Author

@keith-hall, that is a good suggestion.
I modified the Ctags package to call get_jump_history_for_view(view).push_selection(view) just like history_list.py does.
Works great.
Thanks

@wbond
Copy link
Member

wbond commented Aug 19, 2020

As of build 4059, the jump functionality should automatically pick up selection changes in views.

As of build 4083 a number of edge cases were fixed. Additionally, since there are now two plugin hosts (Python 3.3 and 3.8), we have a command add_jump_record in case there is a specific situation in which the jump functionality is not recording a jump point. An example of this would be add a jump point for a hover popup action.

@wbond wbond closed this as completed Aug 19, 2020
@wbond wbond added the R: fixed label Aug 19, 2020
@wbond wbond added this to the Build 4083 milestone Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants