Skip to content

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

Description

@tillt

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions