### Godot version

v4.0.rc1.official [8843d9ad3]

### System information

Windows 11 Pro 64Bit

### Issue description

Hi,

Found a rather annoying bug in 4.0 RC1 official on Windows 11:
When right clicking on a function in code and selecting "Lookup Symbol" - it does not always work?
Sometimes it works, sometimes it does not work?

Any ideas?

Jesse

### Steps to reproduce

Right click on a function in code and select "Lookup Symbol".
(it does not work always?)

### Minimal reproduction project

N.A.
if (!is_editable()) {
		return;
	}
	begin_complex_operation();
	Vector<int> caret_edit_order = get_caret_index_edit_order();
	for (const int &c : caret_edit_order) {
		
		
		
		int removed_characters = 0;
		int initial_selection_end_column = 0;
		int initial_cursor_column = get_caret_column(c);
		int start_line = get_caret_line(c);
		int end_line = start_line;
		if (has_selection(c)) {
			start_line = get_selection_from_line(c);
			end_line = get_selection_to_line(c);
			
			initial_selection_end_column = get_selection_to_column(c);
			if (initial_selection_end_column == 0) {
				end_line--;
			}
		}
		bool first_line_edited = false;
		bool last_line_edited = false;
		for (int i = start_line; i <= end_line; i++) {