### Godot version

4.0 beta 10

### System information

Windows 11

### Issue description

On the text editor when using autocomplete on function arguments that receive Input Map names after autocompleting the function name, the string autocompleted appears with an extra " at the end.
This doesnt happen if you write " and then accept the Input name in the dropdown

### Steps to reproduce

- On the script editor
- Start writing `Input.get_vector` but when the dropdown appears with the autocomplete suggestion for `Input.get_vector` press enter to accept it, then press enter again to accept the Input map suggestion
- The autocompleted input name should have an extra "

### Minimal reproduction project

N/A
if (!is_editable()) {
		return;
	}
	int cc = get_caret_column();
	if (has_selection() || cc <= 0) {
		unindent_lines();
		return;
	}
	begin_complex_operation();
	Vector<int> caret_edit_order = get_caret_index_edit_order();
	for (const int &c : caret_edit_order) {
		int cl = get_caret_line(c);
		const String &line = get_line(cl);
		if (line[cc - 1] == '\t') {
			remove_text(cl, cc - 1, cl, cc);
			set_caret_column(MAX(0, cc - 1), c == 0, c);
			adjust_carets_after_edit(c, cl, cc, cl, cc - 1);
			continue;
		}
		if (line[cc - 1] != ' ') {
			continue;
		}
		int spaces_to_remove = _calculate_spaces_till_next_left_indent(cc);
		if (spaces_to_remove > 0) {
			for (int i = 1; i <= spaces_to_remove; i++) {
				if (line[cc - i] != ' ') {
					spaces_to_remove = i - 1;
					break;
				}