### 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)

autosave_timer = memnew(Timer);
	autosave_timer->set_one_shot(false);
	autosave_timer->connect(SceneStringNames::get_singleton()->tree_entered, callable_mp(this, &ScriptEditor::_update_autosave_timer));
	autosave_timer->connect("timeout", callable_mp(this, &ScriptEditor::_autosave_scripts));
	add_child(autosave_timer);
	grab_focus_block = false;
	help_search_dialog = memnew(EditorHelpSearch);
	add_child(help_search_dialog);
	help_search_dialog->connect("go_to_help", callable_mp(this, &ScriptEditor::_help_class_goto));
	find_in_files_dialog = memnew(FindInFilesDialog);
	find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_FIND_REQUESTED, callable_mp(this, &ScriptEditor::_start_find_in_files).bind(false));
	find_in_files_dialog->connect(FindInFilesDialog::SIGNAL_REPLACE_REQUESTED, callable_mp(this, &ScriptEditor::_start_find_in_files).bind(true));
	add_child(find_in_files_dialog);
	find_in_files = memnew(FindInFilesPanel);
	find_in_files_button = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Search Results"), find_in_files);
	find_in_files->set_custom_minimum_size(Size2(0, 200) * EDSCALE);
	find_in_files->connect(FindInFilesPanel::SIGNAL_RESULT_SELECTED, callable_mp(this, &ScriptEditor::_on_find_in_files_result_selected));
	find_in_files->connect(FindInFilesPanel::SIGNAL_FILES_MODIFIED, callable_mp(this, &ScriptEditor::_on_find_in_files_modified_files));
	find_in_files->hide();
	find_in_files_button->hide();
	history_pos = -1;
	edit_pass = 0;
	trim_trailing_whitespace_on_save = EDITOR_GET("text_editor/behavior/files/trim_trailing_whitespace_on_save");
	convert_indent_on_save = EDITOR_GET("text_editor/behavior/files/convert_indent_on_save");
	use_space_indentation = EDITOR_GET("text_editor/behavior/indent/type");
	ScriptServer::edit_request_func = _open_script_request;
	add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditorPanel"), SNAME("EditorStyles")));
	tab_container->add_theme_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_theme_stylebox(SNAME("ScriptEditor"), SNAME("EditorStyles")));
}
ScriptEditor::~ScriptEditor() {