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

context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_all"), CLOSE_ALL);
	context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/close_other_tabs"), CLOSE_OTHER_TABS);
	context_menu->add_separator();
	if (se) {
		Ref<Script> scr = se->get_edited_resource();
		if (scr != nullptr) {
			if (!scr.is_null() && scr->is_tool()) {
				context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/reload_script_soft"), FILE_TOOL_RELOAD_SOFT);
				context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/run_file"), FILE_RUN);
				context_menu->add_separator();
			}
		}
		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/copy_path"), FILE_COPY_PATH);
		context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/show_in_file_system"), SHOW_IN_FILE_SYSTEM);
		context_menu->add_separator();
	}
	context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_move_up"), WINDOW_MOVE_UP);
	context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_move_down"), WINDOW_MOVE_DOWN);
	context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/window_sort"), WINDOW_SORT);
	context_menu->add_shortcut(ED_GET_SHORTCUT("script_editor/toggle_scripts_panel"), TOGGLE_SCRIPTS_PANEL);
	context_menu->set_item_disabled(context_menu->get_item_index(CLOSE_ALL), tab_container->get_tab_count() <= 0);
	context_menu->set_item_disabled(context_menu->get_item_index(CLOSE_OTHER_TABS), tab_container->get_tab_count() <= 1);
	context_menu->set_item_disabled(context_menu->get_item_index(WINDOW_MOVE_UP), tab_container->get_current_tab() <= 0);
	context_menu->set_item_disabled(context_menu->get_item_index(WINDOW_MOVE_DOWN), tab_container->get_current_tab() >= tab_container->get_tab_count() - 1);
	context_menu->set_item_disabled(context_menu->get_item_index(WINDOW_SORT), tab_container->get_tab_count() <= 1);
	context_menu->set_position(get_screen_position() + get_local_mouse_position());
	context_menu->reset_size();
	context_menu->popup();
}
void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) {