eye.helpers.nav_history module

Module for going back/forward in editors

This module allows recording history of cursor positions when switching to another file or jumping to a function definition for example. Then, navigation can go back and forth between these positions like a browser.

eye.helpers.nav_history.go_back()[source]

Go back in editor position history

eye.helpers.nav_history.go_forward()[source]

Go forward in editor position history

eye.helpers.nav_history.navigate_with_mouse_back(editor)[source]

Use navigation with Back/Forward mouse buttons

Certain mice have dedicated back and forward buttons. When this callback is enabled, back and forward mouse buttons will call go_back and go_forward.

This handler is disabled by default.

This handler is registered as setup for categories ['editor'].

eye.helpers.nav_history.peek_history()[source]

Get the backward history entry that could be navigated

Does not perform any navigation, it just returns a 3-tuple containing the eye.widgets.editor.Editor widget, the line number and column number.

Returns:

the entry to go back or None if there is no history

Return type:

tuple[Editor, int, int] or None

eye.helpers.nav_history.push_history(editor, line, col)[source]

Add an entry in history

Calling this function pushes an entry on top of the backward history (which is a stack) and erases forward history.

eye.helpers.nav_history.push_history_on_editor_change(editor, line, col)[source]

Push a history entry when moving cursor to another editor and position.

This handler is disabled by default.

This handler is registered for categories ['editor'] on signal cursorPositionChanged.

eye.helpers.nav_history.push_history_on_jump(editor, line, col)[source]

This handler is disabled by default.

This handler is registered for categories ['editor'] on signal position_jumped.

eye.helpers.nav_history.set_enabled(enabled)[source]

Toggles push_history_on_editor_change, push_history_on_jump and navigate_with_mouse_back.