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

file_menu->get_popup()->add_separator();
	file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/run_file", TTR("Run"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::X), FILE_RUN);
	file_menu->get_popup()->add_separator();
	file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KeyModifierMask::CMD_OR_CTRL | Key::BACKSLASH), TOGGLE_SCRIPTS_PANEL);
	file_menu->get_popup()->connect("id_pressed", callable_mp(this, &ScriptEditor::_menu_option));
	file_menu->get_popup()->connect("about_to_popup", callable_mp(this, &ScriptEditor::_prepare_file_menu));
	script_search_menu = memnew(MenuButton);
	script_search_menu->set_text(TTR("Search"));
	script_search_menu->set_switch_on_hover(true);
	script_search_menu->set_shortcut_context(this);
	script_search_menu->get_popup()->connect("id_pressed", callable_mp(this, &ScriptEditor::_menu_option));
	menu_hb->add_child(script_search_menu);
	MenuButton *debug_menu_btn = memnew(MenuButton);
	menu_hb->add_child(debug_menu_btn);
	debug_menu_btn->hide(); 
	EditorDebuggerNode *debugger = EditorDebuggerNode::get_singleton();
	debugger->set_script_debug_button(debug_menu_btn);
	debugger->connect("goto_script_line", callable_mp(this, &ScriptEditor::_goto_script_line));
	debugger->connect("set_execution", callable_mp(this, &ScriptEditor::_set_execution));
	debugger->connect("clear_execution", callable_mp(this, &ScriptEditor::_clear_execution));
	debugger->connect("breaked", callable_mp(this, &ScriptEditor::_breaked));
	debugger->get_default_debugger()->connect("set_breakpoint", callable_mp(this, &ScriptEditor::_set_breakpoint));
	debugger->get_default_debugger()->connect("clear_breakpoints", callable_mp(this, &ScriptEditor::_clear_breakpoints));
	menu_hb->add_spacer();
	script_icon = memnew(TextureRect);
	menu_hb->add_child(script_icon);
	script_name_label = memnew(Label);
	menu_hb->add_child(script_name_label);
	script_icon->hide();
	script_name_label->hide();