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

Navigation history should be done based on Sublime's build-in. #44

Open
tillt opened this issue Jan 14, 2020 · 0 comments
Open

Navigation history should be done based on Sublime's build-in. #44

tillt opened this issue Jan 14, 2020 · 0 comments

Comments

@tillt
Copy link
Owner

tillt commented Jan 14, 2020

RTagsComplete implements its own navigation history;

def history_size():
global history
if not history:
return 0
return len(history)
def pop_history():
global history
if not history:
return None
return history.pop()
def push_history(file, line, col):
global history
if not history:
history = collections.deque(
[],
maxlen=int(settings.get('jump_limit', 10)))
history.append([file, line, col])
def return_in_history(view):
global history
if not history_size():
return
file, line, col = pop_history()
view.window().open_file(
'%s:%s:%s' % (file, line, col), sublime.ENCODED_POSITION)

The stack itself should in fact be Sublime's own Default.history_list, enabling the use of the Goto->Jump Back for returning from a RTagsComplete navigation step.

import Default.history_list as history_list
history_list.get_jump_history_for_view(view).push_selection(view)

We might lose the history view though - unsure.

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

No branches or pull requests

1 participant