### Godot version

v4.0.beta.custom_build [cc89fcbd0]

### System information

Linux (Ubuntu 22.04), Vulkan, Radeon RX Vega 64 (eGPU)

### Issue description

The text editor doesn't register in the navigation history the local navigation.

In a large file, the user can CTRL+click on definitions of the same file to navigate quickly to a function or a class in the opened script. When the user clicks on the previous or next buttons, that local navigation seems to be not considered.

See this video for a recreation of the issue:

[Capture vidéo du 2023-01-15 17:57:45.webm](https://user-images.githubusercontent.com/270928/212571752-d05c5d85-cc7f-434b-b020-316f6194ad13.webm)


### Steps to reproduce

1. Open the MRP;
2. Open `main.gd`;
3. CTRL+click on `test()` in `_ready()`;
4. CTRL+click on `Inner` in `test()`;
5. Press on the previous button (or the previous button on your mouse);
6. See that the navigation wasn't registered in the history.

### Minimal reproduction project

[history_local.zip](https://github.com/godotengine/godot/files/10421462/history_local.zip)

_menu_option(WINDOW_MOVE_UP);
		accept_event();
	}
	if (ED_IS_SHORTCUT("script_editor/window_move_down", p_event)) {
		_menu_option(WINDOW_MOVE_DOWN);
		accept_event();
	}
}
void ScriptEditor::_script_list_clicked(int p_item, Vector2 p_local_mouse_pos, MouseButton p_mouse_button_index) {
	if (p_mouse_button_index == MouseButton::MIDDLE) {
		script_list->select(p_item);
		_script_selected(p_item);
		_menu_option(FILE_CLOSE);
	}
	if (p_mouse_button_index == MouseButton::RIGHT) {
		_make_script_list_context_menu();
	}
}
void ScriptEditor::_make_script_list_context_menu() {
	context_menu->clear();
	int selected = tab_container->get_current_tab();
	if (selected < 0 || selected >= tab_container->get_tab_count()) {
		return;
	}
	ScriptEditorBase *se = Object::cast_to<ScriptEditorBase>(tab_container->get_tab_control(selected));
	if (se) {
		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/save"), FILE_SAVE);
		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/save_as"), FILE_SAVE_AS);
	}
	context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_file"), FILE_CLOSE);